码迷,mamicode.com
首页 >  
搜索关键字:count and say    ( 19436个结果
代码案例(结构体,函数指针,指针函数,冒泡排序)
typedefstruct { charname[20]; intage; floatscore; }Stu; #import<Foundation/Foundation.h> //姓名升序 voidsortByName(Stu*p,intcount) { for(inti=0;i<count-1;i++){ for(intj=0;j<count-1-i;j++){ if(strcmp((p+j)->name,(p+j+1)->name)>0){ Stute..
分类:其他好文   时间:2014-07-30 17:51:35    阅读次数:207
UVa 11408 - Count DePrimes
题目:一个数的素因子的和如果也是素数就叫做DePrimes,统计给定区间内的DePrimes。 分析:数论。本题使用用一种素数的筛法,欧拉筛法,也加线性筛法。                         这种方法,每次删选分两种情况:1.素因子不重复、2.素因子重复;                         利用这个性质,统计DePrimes,如果素因子不同就加和,否则就去相应的...
分类:其他好文   时间:2014-07-30 12:20:03    阅读次数:398
CF 17B Hierarchy
Nick's company employed n people. Now Nick needs to build a tree hierarchy of «supervisor-surbodinate» relations in the company (this is to say that each employee, except one, has exactly one superv...
分类:其他好文   时间:2014-07-30 10:06:53    阅读次数:286
Best Time to Buy and Sell Stock III leetcode java
题目:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may com....
分类:编程语言   时间:2014-07-30 05:35:13    阅读次数:260
Best Time to Buy and Sell Stock II leetcode java
题目:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may com....
分类:编程语言   时间:2014-07-30 05:35:03    阅读次数:309
Best Time to Buy and Sell Stock leetcode java
题目:Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transact....
分类:编程语言   时间:2014-07-30 05:34:13    阅读次数:248
动态内存
intcount=0;//定义数组长度printf("请输入数组长度:");scanf("%d",&count);int*p=malloc(sizeof(int)*count);for(inti=0;i<count;i++){*(p+i)=arc4random()%(count-1+1)+1;printf("%d",*(p+i));}printf("\n");intmax=0;for(inti=0;i<count;i++){if(max<*(p+i)){ma..
分类:其他好文   时间:2014-07-30 03:30:33    阅读次数:202
ARC下打印retain count
You can use?CFGetRetainCount?with Objective-C objects, even under ARC: NSLog(@"Retain?count?is?%ld",?CFGetRetainCount((__bridge?CFTypeRef)myObject));...
分类:其他好文   时间:2014-07-30 01:11:23    阅读次数:472
poj 2777 Count Color(线段树区间修改)
题目链接:http://poj.org/problem?id=2777 题目意思:就是问你在询问的区间里有几种不同的颜色 思路:这题和一般的区间修改差不多,但是唯一不同的就是我们要怎么计算有种颜色,所以这时候我们就需要把延时标记赋予不同的意义,当某段区间有多种颜色时就赋值为-1,当为一种颜色时就把它赋值为这个颜色的号数。这儿我们要怎么统计询问区间不同的颜色数叻,为了不重复计算同一种颜色,那么我...
分类:其他好文   时间:2014-07-29 22:05:22    阅读次数:418
hdu 4891 The Great Pan (模拟)
为什么要开__int64 巨巨在哪~# include # include # include using namespace std; int main () { __int64 n,i,len,cot,cot1,count,flag,j; char a[1001][1030]; while(~scanf("%d",&n)) { getcha...
分类:其他好文   时间:2014-07-29 21:58:42    阅读次数:276
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!