并查集的路径压缩。 1 #include 2 #include 3 4 #define MAXNUM
100005 5 6 int deg[MAXNUM], bin[MAXNUM]; 7 char isCycle[MAXNUM]; 8 9 int
find(int x) {10 i...
分类:
其他好文 时间:
2014-04-29 17:22:46
阅读次数:
308
使用字典的坏处一般情况下,设置数据和取出数据都使用“字符串类型的key”,编写这些key时,编译器不会有任何友善提示,需要手敲dict[@"name"] =
@"Jack";NSString *name = dict[@"name"];手敲字符串key,key容易写错Key如果写错了,编译器不会有任...
分类:
移动开发 时间:
2014-04-29 17:21:47
阅读次数:
525
文本输入框作为一个最基本的UI控件,被众多UI框架默认支持。Windows下最简单的就是CEdit(WTL封装),也有更为复杂的CRichEdit(WTL封装)。文本输入框是基本控件中最难实现的控件之一,估计这也是Chrome浏览器(For
Windows)一直使用原生文本输入框封装,而不是自行实现...
分类:
其他好文 时间:
2014-04-29 17:21:46
阅读次数:
492
Problem C: A Walk Through the ForestJimmy
experiences a lot of stress at work these days, especially since his accident
made working difficult. To rel...
分类:
其他好文 时间:
2014-04-29 17:21:46
阅读次数:
368
如果用下面第1行的写法,调用[NSObject
cancelPreviousPerformRequestsWithTarget:self
selector:@selector(removeFromSuperview) object:nil];可以生效如果用下面第3行的写法,调用[NSObject
c...
分类:
其他好文 时间:
2014-04-29 17:21:46
阅读次数:
326
汇编语言是依赖于处理器的。不同的处理器上面的汇编语言是不一样的。
语言的发展有一个趋势,就是离硬件越来越远。从汇编,到C,C++,面向对象的Java等,能够发现,后面的语言越来越具有可移植性,不绝对依赖于底层硬件。比如跨平台的Java,其卖点之一就是其跨平台可移植性。还有一个点,就是越来越抽象...
分类:
其他好文 时间:
2014-04-29 17:21:45
阅读次数:
216
//冒泡排序publicclassbubblesorter{publicvoidsort(int[]list){inti,j,temp;booldone=false;j=1;while((jlist[i+1]){done=false;temp=list[i];list[i]=list[i+1];li...
分类:
其他好文 时间:
2014-04-29 17:21:45
阅读次数:
429
1、CPC(Cost Per Click;Cost Per Thousand
Click-Through)
每点击成本以每点击一次计费。这样的方法加上点击率限制可以加强作弊的难度,而且是宣传网站站点的最优方式。但是,此类方法就有不少经营广告的网站觉得不公平,比如,虽然浏览者没有点击,但是他已经看到了...
分类:
其他好文 时间:
2014-04-29 17:18:47
阅读次数:
406
CDC::GetDeviceCaps()物理长度与屏幕像素间的转换作用:读取DC的一些打印区域信息,主要是像素和英寸方面的数据.声明:GetDeviceCaps(int
)使用例子://所有像素数int pagecx=dc.GetDeviceCaps(HORZRES);int pagecy=dc.G...
分类:
其他好文 时间:
2014-04-29 17:18:47
阅读次数:
342
where do i beginto tell a story of how great a love
can bethe sweet love story that is older than the seathe simple truth about the
love she brings to...
分类:
其他好文 时间:
2014-04-29 17:18:46
阅读次数:
342