摘要:
BabelfishTime Limit: 3000MSMemory Limit: 65536KTotal Submissions: 24748Accepted: 10586DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.InputInput consist 阅读全文
posted @ 2012-08-01 16:53
加拿大小哥哥
阅读(460)
评论(0)
推荐(0)
摘要:
统计难题Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 131070/65535 K (Java/Others)Total Submission(s): 10201Accepted Submission(s): 4156Problem DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统 阅读全文
posted @ 2012-08-01 11:06
加拿大小哥哥
阅读(189)
评论(0)
推荐(0)
摘要:
/*大致题意:n个城市,先把1号断电,继而每隔m断电使标号为2的最后被限电;转化为(n-1)个城市,最后断电的为标号为1的城市,求最小的m*/ #include<stdio.h>bool is_joseph(int m,int n){ int i,j; int s=0; for(i=2;i<=n;i++) s=(s+m)%i; if((s+1)==1) return 1; return 0;}int main(){ int i,j,k; int m,n,s; while(scanf("%d",&n),n) { ... 阅读全文
posted @ 2012-08-01 10:21
加拿大小哥哥
阅读(294)
评论(0)
推荐(0)
摘要:
JosephTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 40823Accepted: 15337DescriptionThe Joseph's problem is notoriously known. For those who are not familiar with the original problem: from among n people, numbered 1, 2, . . ., n, standing in circle every mth is going to be executed an 阅读全文
posted @ 2012-08-01 09:14
加拿大小哥哥
阅读(227)
评论(0)
推荐(0)