导航

上一页 1 ··· 9 10 11 12 13 14 15 下一页

2013年7月22日

摘要: 点击打开链接吝啬的国度时间限制:1000ms | 内存限制:65535KB难度:3描述在一个吝啬的国度里有N个城市,这N个城市间只有N-1条路把这个N个城市连接起来。现在,Tom在第S号城市,他有张该国地图,他想知道如果自己要去参观第T号城市,必须经过的前一个城市是几号城市(假设你不走重复的路)。输入第一行输入一个整数M表示测试数据共有M(1#include#includetypedef struct CHILD{ int num; struct CHILD * next;}Child;typedef struct NODE { int num; int flag; Child * head; 阅读全文

posted @ 2013-07-22 20:52 勇敢的炮灰 阅读(174) 评论(0) 推荐(0)

摘要: 点击打开链接擅长排列的小明时间限制:1000ms | 内存限制:65535KB难度:4描述小明十分聪明,而且十分擅长排列计算。比如给小明一个数字5,他能立刻给出1-5按字典序的全排列,如果你想为难他,在这5个数字中选出几个数字让他继续全排列,那么你就错了,他同样的很擅长。现在需要你写一个程序来验证擅长排列的小明到底对不对。输入第一行输入整数N(1int haxi[10];int j , k ;int f(int n , int m){ int i; if(n == 0) { printf("%d\n" , m); return 0; } for(i = 1 ; i < 阅读全文

posted @ 2013-07-22 20:46 勇敢的炮灰 阅读(149) 评论(0) 推荐(0)

摘要: 点击打开链接Network of SchoolsTime Limit:1000MSMemory Limit:10000KTotal Submissions:9214Accepted:3654DescriptionA number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distributes software (the “receiv 阅读全文

posted @ 2013-07-22 20:32 勇敢的炮灰 阅读(133) 评论(0) 推荐(0)

摘要: 点击打开链接The Triangle时间限制:1000ms | 内存限制:65535KB难度:4描述73 88 1 02 7 4 44 5 2 6 5(Figure 1)Figure 1 shows a number triangle. Write a program that calculates the highest sum of numbers passed on a route that starts at the top and ends somewhere on the base. Each step can go either diagonally down to the le 阅读全文

posted @ 2013-07-22 01:39 勇敢的炮灰 阅读(135) 评论(0) 推荐(0)

摘要: 点击打开链接单调递增最长子序列时间限制:3000ms | 内存限制:65535KB难度:4描述求一个字符串的最长递增子序列的长度如:dabdbf最长递增子序列就是abdf,长度为4输入第一行一个整数0#includeint dp[10001];char str[10001];int max;int main(){ int num; scanf("%d" , &num); getchar(); while(num--) { gets(str); int i , j; max = 1; // for(i = 0 ; str[i] ; i++)// dp[i] = 1; 阅读全文

posted @ 2013-07-22 01:31 勇敢的炮灰 阅读(105) 评论(0) 推荐(0)

2013年7月21日

摘要: 点击打开链接Popular CowsTime Limit:2000MSMemory Limit:65536KTotal Submissions:19665Accepted:7970DescriptionEvery cow's dream is to become the most popular cow in the herd. In a herd of N (1 B, B->C,那么第二次遍历的顺序也要先从A开始),这样搜索到的每个节点都和根节点是在同一个强连通分量里,同时可以给没一个强连通分量分配一个标记值,一般理解成颜色,同一个颜色是一个强连通分量,,然后每个强连通分量可以 阅读全文

posted @ 2013-07-21 02:02 勇敢的炮灰 阅读(155) 评论(0) 推荐(0)

2013年7月20日

摘要: 点击打开链接矩形嵌套时间限制:3000ms | 内存限制:65535KB难度:4描述有n个矩形,每个矩形可以用a,b来描述,表示长和宽。矩形X(a,b)可以嵌套在矩形Y(c,d)中当且仅当a#includetypedef struct NODE{ int x, y;}Node;int comp(const void *a, const void *b){ return ((*(Node *)a).x)*(*(Node *)a).y - ((*(Node *)b).x) * ((*(Node *)b).y );}Node rect[101];int dp[101];int main(){ int 阅读全文

posted @ 2013-07-20 13:44 勇敢的炮灰 阅读(255) 评论(0) 推荐(0)

摘要: 点击打开链接会场安排问题时间限制:3000ms | 内存限制:65535KB难度:4描述学校的小礼堂每天都会有许多活动,有时间这些活动的计划时间会发生冲突,需要选择出一些活动进行举办。小刘的工作就是安排学校小礼堂的活动,每个时间最多安排一个活动。现在小刘有一些活动计划的时间表,他想尽可能的安排更多的活动,请问他该如何安排。输入第一行是一个整型数m(m#include#includeint s(const void *a , const void * b){ return *(int *)a - *(int *)b;}int main(){ int num , num2; int flag , 阅读全文

posted @ 2013-07-20 13:33 勇敢的炮灰 阅读(219) 评论(0) 推荐(0)

摘要: 点击打开链接喷水装置(二)时间限制:3000ms | 内存限制:65535KB难度:4描述有一块草坪,横向长w,纵向长为h,在它的橫向中心线上不同位置处装有n(n#include#includetypedef struct NODE{ double head, tail;}Node;int comp(const void *a, const void *b){ return (*(Node*)a).head > (*(Node*)b).head ? 1 : -1;}Node area[10000];int main(){ int n; scanf("%d", & 阅读全文

posted @ 2013-07-20 12:59 勇敢的炮灰 阅读(789) 评论(0) 推荐(0)

2013年7月19日

摘要: 点击打开链接hud点击打开链接pojEightTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9141Accepted Submission(s): 2459Special JudgeProblem DescriptionThe 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it 阅读全文

posted @ 2013-07-19 02:52 勇敢的炮灰 阅读(157) 评论(0) 推荐(0)

上一页 1 ··· 9 10 11 12 13 14 15 下一页