摘要:
Max SumTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 113459Accepted Submission(s): 26237Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the ma 阅读全文
摘要:
亲和串Time Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6045Accepted Submission(s): 2736problem Description人随着岁数的增长是越大越聪明还是越大越笨,这是一个值得全世界科学家思考的问题,同样的问题Eddy也一直在思考,因为他在很小的时候就知道亲和串如何判断了,但是发现,现在长大了却不知道怎么去判断亲和串了,于是他只好又再一次来请教聪明且乐于助人的你来解决这个问题。亲和串的定义是这样的:给定两个字符 阅读全文
摘要:
N!Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 43866Accepted Submission(s): 12335Problem DescriptionGiven an integer N(0 ≤ N ≤ 10000), your task is to calculate N!InputOne N in one line, process to the end of file.OutputFor each N, output N! in 阅读全文
摘要:
Let the Balloon RiseTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 58098Accepted Submission(s): 21290Problem DescriptionContest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time 阅读全文
摘要:
字母统计时间限制:3000 ms | 内存限制:65535 KB难度:1描述现在给你一个由小写字母组成字符串,要你找出字符串中出现次数最多的字母,如果出现次数最多字母有多个那么输出最小的那个。输入第一行输入一个正整数T(0#includeint main(){ int n,i,j,k,l,max; char a[1020]; char c; scanf("%d",&n); while(n--) { max=0; scanf("%s",a); l=strlen(a); for(i=0;ia[i]) c=a[i]; } } } printf(&quo 阅读全文
摘要:
街区最短路径问题时间限制:3000 ms | 内存限制:65535 KB难度:4描述一个街区有很多住户,街区的街道只能为东西、南北两种方向。住户只可以沿着街道行走。各个街道之间的间隔相等。用(x,y)来表示住户坐在的街区。例如(4,20),表示用户在东西方向第4个街道,南北方向第20个街道。现在要建一个邮局,使得各个住户到邮局的距离之和最少。求现在这个邮局应该建在那个地方使得所有住户距离之和最小;输入第一行一个整数n#include#includeint cmp(const void *a,const void *b){ return *(int *)a-*(int *)b;}int main 阅读全文
摘要:
绝对值排序Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 30429Accepted Submission(s): 15014Problem Description输入n(n#include#includeint cmp(const void *a,const void *b){ return abs(*(int *)a)-abs(*(int *)b);}int main(){ int n,i; int a[105]; while(scanf( 阅读全文
摘要:
奇怪的排序时间限制:1000 ms | 内存限制:65535 KB难度:1描述最近,Dr. Kong 新设计一个机器人Bill.这台机器人很聪明,会做许多事情。惟独对自然数的理解与人类不一样,它是从右往左读数.比如,它看到123时,会理解成321.让它比较23与15哪一个大,它说15大。原因是它的大脑会以为是32与51在进行比较.再比如让它比较29与30,它说29大.给定Bill两个自然数A和B,让它将 [A,B] 区间中的所有数按从小到大排序出来。你会认为它如何排序?输入第一行: N表示有多少组测试数据. (2#includetypedef struct No{ int mm; int m; 阅读全文
摘要:
素数判定Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 56748Accepted Submission(s): 19499 Problem Description对于表达式n^2+n+41,当n在(x,y)范围内取整数值时(包括x,y)(-39int main(){int x,y;int fun(int a,int b);int fun1(int t);while(scanf("%d %d",&x,&y) 阅读全文
摘要:
偶数求和Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 35198Accepted Submission(s): 15300 Problem Description有一个长度为n(nint main(){int n,m;while(scanf("%d %d",&n,&m)!=EOF){int i=2,p,k,q=0,a=0;p=n;while(n>=m){k=0;for(i;i<=q+2*m;i 阅读全文