12 2015 档案

摘要:一、scanf和gets 1.不同点: char string[50]; scanf("%s",string); //当遇到回车,空格和tab键会自动在字符串后面添加'\0',但是不能接受回车,空格和tab键,他们仍会留在输入的缓冲区中。 gets(string); //遇到回车认为输入结束,并用' 阅读全文
posted @ 2015-12-18 13:19 水郁 阅读(559) 评论(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 水郁 阅读(313) 评论(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 水郁 阅读(438) 评论(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 水郁 阅读(460) 评论(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 水郁 阅读(552) 评论(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 水郁 阅读(455) 评论(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 水郁 阅读(427) 评论(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 水郁 阅读(438) 评论(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 水郁 阅读(645) 评论(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 水郁 阅读(944) 评论(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 水郁 阅读(2149) 评论(0) 推荐(0) 编辑
摘要:题目描述 Description 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统。但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能高于前一发的高度。某天,雷达捕捉到敌国的导弹来袭。由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹 阅读全文
posted @ 2015-12-01 14:15 水郁 阅读(3803) 评论(2) 推荐(3) 编辑

欢迎这位怪蜀黍来到《2015 年 12月 随笔档案 - 水郁 - 博客园》
点击右上角即可分享
微信分享提示