现在位置: 首页 > mucus发表的所有文章
  • 09月
  • 22日
算法 ⁄ 共 2264字 评论关闭
此处的讲解更加详细与系统,代码也要好看100倍。 /* * poj1151 AC * 线段树+线段扫描+矩形分割 * 计算平面上重叠矩形的总面积的经典问题 * * 代码又长又丑,完全不能忍了。 * * 实数坐标需要离散化,并且需要一个简单的hash数组对应 * 分割方式有两种,纵向与横向,此处采用纵向分割。 * 构造线段树时,注意其区间此处取[l,r)更为方便合适。 * 初始化结构数组时,用构造函数。 * * */ #include<cstdio> #include<algorithm> using namespace std; struct NODE { double x1,x2,y; bool up; }yy[1000];......
阅读全文
  • 04月
  • 16日
综合 ⁄ 共 552字 评论关闭
  main是C/C++的标准入口函数名 WinMain是windows API窗体程序的入口函数。(int WINAPI WinMain()) 中 WINAPI是__stdcall宏,在windef.h中定义的。 _tmain _tWinMain 是Unicode版本函数别名,对应与wmain和wWinMain。 ***************************************************************************************** <tchar.h>中有如下几行: #ifdef _UNICODE #define _tmain      wmain #define _tWinMain   wWinMain #else   /* ndef _UNICODE */ #define _tmain      main #define _tWinMain   WinMain #endif 这样定义是为......
阅读全文
  • 10月
  • 23日
综合 ⁄ 共 7368字 评论关闭
本文摘自:《SAS/GRAPH® for the Timid》——Earl Westerlund, University of Rochester, Rochester, NY ABSTRACTSAS/GRAPH is one of the foundation products of SAS®, and an invaluable tool for anybody who needs to see the information in the data. Its procedures work the same way as any other procedure. But the number of procedures, statements and options available are so numerous – and, in many cases, cryptic – that many people become intimidated. The purpose of this paper is to provide a gentle i......
阅读全文
  • 08月
  • 21日
综合 ⁄ 共 5994字 评论关闭
在iOS4之前,加速度计由UIAccelerometer类来负责采集工作,而电子罗盘则由Core Location接管。而iPhone4的推出,由于加速度计的升级(有消息说使用的是这款芯片) 和陀螺仪的引入,与motion相关的编程成为重头戏,所以,苹果在iOS4中增加一个一个专门负责该方面处理的框架,就是Core Motion Framework。这个Core Motion有什么好处呢?简单来说,它不仅仅提供给你获得实时的加速度值和旋转速度值,更重要的是,苹果在其中集成了很多算法,可以直接给你输出把重力 加速度分量剥离的加速度,省去你的高通滤波操作,以及提供给你一个......
阅读全文
  • 06月
  • 10日
综合 ⁄ 共 1423字 评论关闭
 #region------------------------------Sql Server 数据库操作 示例----------------------------------------------         /// <summary>         /// Sql Server  数据库操作         /// </summary>         public static void SqlServerDemo()         {             string sqlConnStr = "Data Source=;Initial Catalog=;User=root;Password=;";             SqlConnection sqlConn = new SqlConnection(sqlConnStr);             sqlConn.Open();                     #region------------查询,利用SqlDat......
阅读全文
  • 05月
  • 24日
综合 ⁄ 共 766字 评论关闭
 第十章 操作系统引论  10.1 联机命令接口 10.2 程序接口 10.3 图形用户接口元素 10.4 图形用户接口元素的基本操作    10.1 联机命令接口 联接命令接口:分时系统中 脱机命令接口:批处理系统中——作业控制命令 1.命令格式(阅读) 2.联机命令的类型 系统访问类 磁盘操作类 文件操作类 目录操作类 通信类 其他命令 3.终端处理程序: 接收用户从终端上打入的字符; 字符缓冲,暂存所接收的字符; 回送显示; 屏幕编辑; 特殊字符处理。 4.命令解释程序: 命令解释程序的作用 命令解释程序的组成 命令解释程序的工作流程 1......
阅读全文
  • 04月
  • 24日
综合 ⁄ 共 2155字 评论关闭
Description Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strategy is to separate the suspects from others.  In the Not-Spreading-Your-Sickness University (NSYSU), there are many student groups. Students in the same group intercommunicate with each other frequently, and a student may join several groups. To prevent the possible transmissions of SARS, ......
阅读全文
  • 03月
  • 20日
综合 ⁄ 共 397字 评论关闭
自己试试下就能弄得非常明白了(vc6.0下测试) #include <stdio.h> #include <string.h> int main() { char str1[] = {"hello world"};//数组有12个元素,包括'\0' char str2[12] = {"hello world"};//数组有12个元素,包括'\0' char str3[11] = {'h','e','l','l','o',' ','w','o','r','l','d'};////数组有11个元素,不包括'\0' printf("%s\n%s\n%d\n",str1,str2,strlen(str2));//可以正常打印 printf("%s\n",str3);//看情况,若数组后面的内存区域中有终止符,则能正常打印,但会出现乱码等意想不到的......
阅读全文
  • 01月
  • 13日
综合 ⁄ 共 930字 评论关闭
#include<iostream> #include<cstring> #include<cstdio> #define N 200001 using namespace std; char ch[N]; int a[N],n,k,v[N],sa[2][N],rank[2][N]; void init(){ scanf("%s",ch+1); n=strlen(ch+1); for(int i=1;i<=n;i++){ a[i+n]=a[i]=int(ch[i]); ch[i+n]=ch[i]; } n<<=1; } void Calc_SA(int sa[N],int rank[N],int SA[N],int Rank[N]){ for(int i=1;i<=n;i++)v[rank[sa[i]]]=i; for(int i=n;i>=1;i--) if(sa[i]>k)SA[v[rank[sa[i]-k]]--]=sa[i]-k; for(int i=n-k+1;i......
阅读全文
  • 01月
  • 12日
综合 ⁄ 共 1771字 评论关闭
文章目录 题目大意: Power Network 题目链接:http://poj.org/problem?id=1459 题目大意: 有一个电网,其中有N个结点,分为np个发电厂,每个发电厂发电。nc个用户,每个用户要用电。以及N-np-nc个中间站,只负责传送电量。有M条边连接着这些结点,每条边上有最大的电量限制。问用户最多在同一时间可以用多少电? 解题思路: 构造一个超级源点,加上每个源点到发电站的边,边的权值为发电站的发电量。构造一个超级汇点,每个用户到汇点有边,边的权值为用户的用电......
阅读全文
  • 12月
  • 27日
综合 ⁄ 共 1665字 评论关闭
for/in循环 链接: http://www.mangguo.org/javascript-for-in-loop-trap/ 链接: http://hi.baidu.com/cqgphper/item/cdf4d1b6bf7f6281eaba9301 链接:http://www.cnblogs.com/rubylouvre/p/3396042.html 关于for/in循环,先看下面的几个例子: var array=[1,2,3,4,5]; var result = []; for(var i=0;i<array.length;i++){ result.push(array[i]); } alert(result.join(''));//12345 var array=[1,2,3,4,5 ]; var result=[]; for(var i in array){ result.push(array[i]); } alert(result.join(''));//12345 va......
阅读全文
  • 12月
  • 14日
综合 ⁄ 共 4717字 评论关闭
1、Java邮件开发介绍 为什么要学习javamail开发 现在很多WEB应用在开发时都需要集成邮件发送功能,例如:  给新注册的用户自动发送一封包含其注册信息的欢迎E-Mail。 给过生日的注册会员自动发送一封表示祝贺的E-Mail 。 将网站的最新活动信息通过E-Mail发送给所有的注册会员。 等等 …... 这些功能的实现都需要软件开发人员在开发WEB应用中编写相应的邮件处理程序。 2、邮件服务器和电子邮箱  (1)邮件服务器: 要在Internet上提供电子邮件功能,必须有专门的电子邮件服务器。例如现在Internet很多提供邮件服务的厂商:sina、sohu......
阅读全文