摘要: http://acm.hust.edu.cn/vjudge/contest/view.action?cid=102419#problem/A In an open credit system, the students can choose any course they like, but the 阅读全文
posted @ 2016-01-05 16:25 水郁 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 一、scanf和gets 1.不同点: char string[50]; scanf("%s",string); //当遇到回车,空格和tab键会自动在字符串后面添加'\0',但是不能接受回车,空格和tab键,他们仍会留在输入的缓冲区中。 gets(string); //遇到回车认为输入结束,并用' 阅读全文
posted @ 2015-12-18 13:19 水郁 阅读(555) 评论(0) 推荐(0) 编辑
摘要: Description In Absurdistan, there are n towns (numbered 1 through n) and m bidirectional railways. There is also an absurdly simple road network — for 阅读全文
posted @ 2015-12-15 00:26 水郁 阅读(308) 评论(0) 推荐(0) 编辑
摘要: Description When Xellos was doing a practice course in university, he once had to measure the intensity of an effect that slowly approached equilibriu 阅读全文
posted @ 2015-12-15 00:19 水郁 阅读(428) 评论(0) 推荐(0) 编辑
摘要: Description Kevin Sun wants to move his precious collection of n cowbells from Naperthrill to Exeter, where there is actually grass instead of corn. B 阅读全文
posted @ 2015-12-14 15:18 水郁 阅读(453) 评论(0) 推荐(0) 编辑
摘要: Description After making bad dives into swimming pools, Wilbur wants to build a swimming pool in the shape of a rectangle in his backyard. He has set 阅读全文
posted @ 2015-12-14 15:12 水郁 阅读(548) 评论(0) 推荐(0) 编辑
摘要: Description Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores locat 阅读全文
posted @ 2015-12-14 15:07 水郁 阅读(451) 评论(0) 推荐(0) 编辑
摘要: http://acm.hust.edu.cn/vjudge/contest/view.action?cid=102271#problem/C Description After seeing the "ALL YOUR BASE ARE BELONG TO US" meme for the firs 阅读全文
posted @ 2015-12-14 14:58 水郁 阅读(424) 评论(0) 推荐(0) 编辑
摘要: http://acm.hust.edu.cn/vjudge/contest/view.action?cid=102271#problem/B Description Kevin Sun has just finished competing in Codeforces Round #334! The 阅读全文
posted @ 2015-12-14 14:48 水郁 阅读(435) 评论(0) 推荐(0) 编辑
摘要: http://acm.hust.edu.cn/vjudge/contest/view.action?cid=102271#problem/A Description Carl is a beginner magician. He has a blue, b violet and c orange m 阅读全文
posted @ 2015-12-14 14:23 水郁 阅读(642) 评论(7) 推荐(0) 编辑
摘要: 快速幂算法思想:迭代/二进制 我们知道一个公式:a*b%c=(a%c*b%c)%c 如果要求ab%c: 一、迭代 当b为奇数:ab%c=((a2)b/2*a)%c,记k=a2%c,那就是求(kb/2%c*a)%c 当b为偶数:ab%c=(a2)b/2%c,记k=a2%c,那就是求kb/2%c 然后问 阅读全文
posted @ 2015-12-13 11:09 水郁 阅读(939) 评论(0) 推荐(0) 编辑
摘要: 关于KMP算法的原理网上有很详细的解释,我试着总结理解一下: KMP算法是什么 以这张图片为例子 匹配到j=5时失效了,BF算法里我们会使i=1,j=0,再看s的第i位开始能不能匹配,而KMP算法接下来就去比较T[2](next[5]=2)和S[5] next数组什么意思? 就是当t[i]不匹配时, 阅读全文
posted @ 2015-12-03 22:35 水郁 阅读(2144) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Description 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统。但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能高于前一发的高度。某天,雷达捕捉到敌国的导弹来袭。由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹 阅读全文
posted @ 2015-12-01 14:15 水郁 阅读(3667) 评论(2) 推荐(3) 编辑
摘要: 题目链接: CODE[VS] 1014 装箱问题 题目描述 Description 有一个箱子容量为V(正整数,0<=V<=20000),同时有n个物品(0<n<=30),每个物品有一个体积(正整数)。 要求n个物品中,任取若干个装入箱内,使箱子的剩余空间为最小。 输入描述 Input Descri 阅读全文
posted @ 2015-11-30 14:00 水郁 阅读(444) 评论(0) 推荐(0) 编辑
摘要: 参考:http://bbs.byr.cn/#!article/ACM_ICPC/11777 OJ上的一些水题(可用来练手和增加自信)(poj3299,poj2159,poj2739,poj1083,poj2262,poj1503,poj3006,poj2255,poj3094) 初期: 一.基本算法 阅读全文
posted @ 2015-11-29 21:40 水郁 阅读(8801) 评论(1) 推荐(5) 编辑
……