摘要:
D - Friends and Subsequences Description Mike and !Mike are old childhood rivals, they are opposite in everything they do, except programming. Today t 阅读全文
摘要:
C - Mike and Chocolate Thieves Description Bad news came to Mike's village, some thieves stole a bunch of chocolates from the local factory! Horrible! 阅读全文
摘要:
B - Mike and Shortcuts Description Recently, Mike was very busy with studying for exams and contests. Now he is going to chill a bit by doing some sig 阅读全文
摘要:
A - Mike and Cellphone Description While swimming at the beach, Mike has accidentally dropped his cellphone into the water. There was no worry as he b 阅读全文
摘要:
A 题目连接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=117542#problem/A 题意:给出n个单词(字符串),选出最长的字符串,要求选出的字符串中的字符不超过2种,输出满足条件 的字符串的长度。 分析:因为只有26个字符,所 阅读全文
摘要:
题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=117538#problem/C 题目大意:给出一个字符串,然后给出一系列的x,y;把字符串中的x与y字母交换 分析:把26个字母中间的x,y交换,在输出的后做处理即可; 如果直接循 阅读全文
摘要:
最大公倍数的最小和 题意: 给一个数字n,范围在[1,2^23-1],这个n是一系列数字的最小公倍数,这一系列数字的个数至少为2 那么找出一个序列,使他们的和最小。 分析: 一系列数字a1,a2,a3……an,他们的LCM是n,那么什么时候他们是最优解(和最小)呢,当他们两两互质的时候。 a和b的L 阅读全文
摘要:
uva10375 Choose and Divide(唯一分解定理) 题意: 已知C(m,n)=m! / (n!*(m-n!)),输入整数p,q,r,s(p>=q,r>=s,p,q,r,s<=10000), 计算C(p,q)/C(r,s)。输出保证不超过10^8,保留5位小数。 分析: 本题时间上基 阅读全文
摘要:
巨大的斐波那契数 The i'th Fibonacci number f (i) is recursively defined in the following way: f (0) = 0 and f (1) = 1 f (i+2) = f (i+1) + f (i) for every i ≥ 阅读全文
摘要:
E. 畅通工程续 某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。 Input 本题 阅读全文