摘要: Function Run FunTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 14939 Accepted: 7735 DescriptionWe all love recursion! Don't we? Consider a three-parameter recursive function w(a, b, c): if a 20 or b > 20 or c > 20, then w(a, b, c) returns: w(20, 20, 20) if a 20||b>20||c>2 阅读全文
posted @ 2013-08-12 21:13 夏子藤 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 表达式求值时间限制:3000 ms | 内存限制:65535 KB 难度:3描述 Dr.Kong设计的机器人卡多掌握了加减法运算以后,最近又学会了一些简单的函数求值,比如,它知道函数min(20,23)的值是20 ,add(10,98) 的值是108等等。经过训练,Dr.Kong设计的机器人卡多甚至会计算一种嵌套的更复杂的表达式。假设表达式可以简单定义为:1. 一个正的十进制数 x 是一个表达式。2. 如果 x 和 y 是 表达式,则 函数min(x,y )也是表达式,其值为x,y 中的最小数。3. 如果 x 和 y 是 表达式,则 函数max(x,y )也是表达式,其值为x,y 中的最大数。 阅读全文
posted @ 2013-08-09 17:15 夏子藤 阅读(177) 评论(0) 推荐(0) 编辑
摘要: EncodingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 21532 Accepted Submission(s): 9384Problem DescriptionGiven a string containing only 'A' - 'Z', we could encode it using the following method: 1. Each sub-string containing k s 阅读全文
posted @ 2013-08-08 10:02 夏子藤 阅读(160) 评论(0) 推荐(0) 编辑
摘要: A + B Problem IITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 166925 Accepted Submission(s): 31927Problem DescriptionI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.InputThe first line 阅读全文
posted @ 2013-08-07 20:01 夏子藤 阅读(161) 评论(0) 推荐(0) 编辑
摘要: N!Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 43926 Accepted Submission(s): 12358Problem 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! 阅读全文
posted @ 2013-08-07 17:19 夏子藤 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 我排第几个时间限制:1000 ms | 内存限制:65535 KB 难度:3描述 现在有"abcdefghijkl”12个字符,将其所有的排列中按字典序排列,给出任意一种排列,说出这个排列在所有的排列中是第几小的?输入 第一行有一个整数n(0int main(){int n;scanf("%d",&n);while(n--){char a[15];long sum=0,c;int b,i,j,d,k=0;scanf("%s",a); for(i=0;ia[j]) {b++;} } //printf("%d\n",b) 阅读全文
posted @ 2013-08-06 21:29 夏子藤 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 街区最短路径问题时间限制:3000 ms | 内存限制:65535 KB 难度:4描述 一个街区有很多住户,街区的街道只能为东西、南北两种方向。住户只可以沿着街道行走。各个街道之间的间隔相等。用(x,y)来表示住户坐在的街区。例如(4,20),表示用户在东西方向第4个街道,南北方向第20个街道。现在要建一个邮局,使得各个住户到邮局的距离之和最少。求现在这个邮局应该建在那个地方使得所有住户距离之和最小;输入 第一行一个整数n#include #include //int x[110],y[110],c[110],d[110];//放在这里也是可以的int cmp(const void*a,con 阅读全文
posted @ 2013-08-06 10:58 夏子藤 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 奇怪的排序时间限制: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//#include //int cmp(const void *a,con 阅读全文
posted @ 2013-08-05 17:36 夏子藤 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 绝对值排序 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 30409 Accepted Submission(s): 14999Problem Description输入n(n#include int main(){ int i,j,t,m; while(scanf("%d",&m)&&m!=0) { int a[120],sum=0,k=0; //scanf("%d",&am 阅读全文
posted @ 2013-08-05 10:48 夏子藤 阅读(251) 评论(0) 推荐(0) 编辑
摘要: Problem E Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 148 Accepted Submission(s) : 38Font: Times New Roman | Verdana | Georgia Font Size: ← →Problem Description对于表达式n^2+n+41,当n在(x,y)范围内取整数值时(包括x,y)(-39int sushu(int n){int i;if(n>1){if(n==2)r 阅读全文
posted @ 2013-08-05 10:45 夏子藤 阅读(163) 评论(0) 推荐(0) 编辑