2015年1月20日

Worm

摘要: Description自从见识了平安夜苹果的涨价后,Lele就在他家门口水平种了一排苹果树,共有N棵。突然Lele发现在左起第P棵树上(从1开始计数)有一条毛毛虫。为了看到毛毛虫变蝴蝶的过程,Lele在苹果树旁观察了很久。虽然没有看到蝴蝶,但Lele发现了一个规律:每过1分钟,毛毛虫会随机从一棵树爬... 阅读全文

posted @ 2015-01-20 20:18 梦林``ysl 阅读(173) 评论(0) 推荐(0) 编辑

亲和串

摘要: 1 #include //亲和串的c语言代码 2 #include 3 char s1[200020],s2[100010],s3[200020]; 4 int main() 5 { 6 int l1, l2; 7 while(gets(s1)) 8 { 9 ... 阅读全文

posted @ 2015-01-20 20:17 梦林``ysl 阅读(207) 评论(0) 推荐(0) 编辑

n个数的最小公倍数

摘要: Description求n个数的最小公倍数。Input输入包含多个测试实例,每个测试实例的开始是一个正整数n,然后是n个正整数。Output为每组测试数据输出它们的最小公倍数,每个测试实例的输出占一行。你可以假设最后的输出是一个32位的整数。Sample Input2 4 63 2 5 7Sampl... 阅读全文

posted @ 2015-01-20 20:15 梦林``ysl 阅读(173) 评论(0) 推荐(0) 编辑

整除的尾数

摘要: Description一个整数,只知道前几位,不知道末二位,被另一个整数除尽了,那么该数的末二位该是什么呢?Input输入数据有若干组,每组数据包含二个整数a,b(0int main (){ int a, b, num, i, flag, x; while(scanf ("%d%d", &a, &b... 阅读全文

posted @ 2015-01-20 20:13 梦林``ysl 阅读(310) 评论(0) 推荐(0) 编辑

Substrings 子字符串-----搜索

摘要: DescriptionYou are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such that either X, or its inverse ca... 阅读全文

posted @ 2015-01-20 19:19 梦林``ysl 阅读(378) 评论(0) 推荐(1) 编辑

N的互质数----欧拉函数

摘要: Description新年快到了,“猪头帮协会”准备搞一个聚会,已经知道现有会员N人,把会员从1到N编号,其中会长的号码是N号,凡是和会长是老朋友的,那么该会员的号码肯定和N有大于1的公约数,否则都是新朋友,现在会长想知道究竟有几个新朋友?请你编程序帮会长计算出来。Input第一行是测试数据的组数C... 阅读全文

posted @ 2015-01-20 19:10 梦林``ysl 阅读(263) 评论(0) 推荐(0) 编辑

Red and Black ---路线问题

摘要: There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he c... 阅读全文

posted @ 2015-01-20 11:42 梦林``ysl 阅读(212) 评论(0) 推荐(0) 编辑

导航