
算法
文章平均质量分 83
夏方方
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
[C++]Saving the Universe——Google Code Jam Qualification Round 2008
Google Code Jam 2008 资格赛的第一题:Saving the Universe。问题描述如下:ProblemThe urban legend goes that if you go to the Google homepage and search for "Google", the universe will implode. We have a s原创 2015-03-25 22:05:18 · 652 阅读 · 0 评论 -
[C++]Store Credit——Google Code Jam Qualification Round Africa 2010
Google Code Jam Qualification Round Africa 2010 的第一题,很简单。ProblemYou receive a credit C at a local store and would like to buy two items. You first walk through the store and create a list L of原创 2015-03-29 22:31:03 · 548 阅读 · 0 评论 -
[C++]让CPU使用率曲线呈现为正弦曲线(一)
看《编程之美》的第一题就很有意思:写一个程序,让用户来决定Windows任务管理器的CPU占用率。可以实现下面三种情况:1. CPU的占用率固定在50%,为一条直线;2. CPU的占用率为条直线,但是具体占用率由命令行参数觉得(1~100);3.CPU的占用率状态是一个正弦曲线问题一我开始是按照书上的做法来的,让CPU在一半的时间工作(一个空循环),另一半的时间Sleep。原创 2015-04-08 18:22:47 · 1759 阅读 · 0 评论 -
[C++]Infinite House of Pancakes——Google Code Jam 2015 Qualification Round
Problem It’s opening night at the opera, and your friend is the prima donna (the lead female singer). You will not be in the audience, but you want to make sure she receives a standing ovation – w原创 2015-04-13 23:37:58 · 487 阅读 · 0 评论 -
[C++]Standing Ovation——Google Code Jam 2015 Qualification Round
ProblemIt’s opening night at the opera, and your friend is the prima donna (the lead female singer). You will not be in the audience, but you want to make sure she receives a standing ovation – with ev原创 2015-04-13 22:17:45 · 491 阅读 · 0 评论 -
[C++]KMP算法实现
KMP算法说明:http://zh.wikipedia.org/wiki/%E5%85%8B%E5%8A%AA%E6%96%AF-%E8%8E%AB%E9%87%8C%E6%96%AF-%E6%99%AE%E6%8B%89%E7%89%B9%E7%AE%97%E6%B3%95 #include<string>using namespace std;class KMP{public: KM原创 2015-04-25 12:56:07 · 479 阅读 · 0 评论