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
题目:一个数的素因子的和如果也是素数就叫做DePrimes,统计给定区间内的DePrimes。
分析:数论。本题使用用一种素数的筛法,欧拉筛法,也加线性筛法。
这种方法,每次删选分两种情况:1.素因子不重复、2.素因子重复;
利用这个性质,统计DePrimes,如果素因子不同就加和,否则就去相应的...
分类:
其他好文 时间:
2014-07-30 12:20:03
阅读次数:
398
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
题目: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
题目: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
题目: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
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
题目链接:http://poj.org/problem?id=2777
题目意思:就是问你在询问的区间里有几种不同的颜色
思路:这题和一般的区间修改差不多,但是唯一不同的就是我们要怎么计算有种颜色,所以这时候我们就需要把延时标记赋予不同的意义,当某段区间有多种颜色时就赋值为-1,当为一种颜色时就把它赋值为这个颜色的号数。这儿我们要怎么统计询问区间不同的颜色数叻,为了不重复计算同一种颜色,那么我...
分类:
其他好文 时间:
2014-07-29 22:05:22
阅读次数:
418
为什么要开__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