随笔分类 -  topcoder

1

srm 581 DIV1
摘要:第一题都没做出来,伤不起~~~ 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <map> 6 #include <algorithm> 7 #include <stack> 8 #include <queue> 9 #include <cmath>10 #include <queue>11 using namespace std;12 阅读全文

posted @ 2013-06-04 23:20 kakamilan 阅读(565) 评论(0) 推荐(0)

srm 580 div1
摘要:要答辩,木有时间啊,练习了一下,依旧不给力,只能做出第一个,啥时候第二个能轻易做出来,也就说明我进步了吧~~~1、离散所有点就可以了 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 6 #include <map> 7 #include <algorithm> 8 #include <list> 9 #include <ctime>1 阅读全文

posted @ 2013-05-27 21:33 kakamilan 阅读(199) 评论(0) 推荐(0)

srm 579 DIV1
摘要:1、div的水平太难了,加上clean code看多了,写的太长了,凑活着看吧.... 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 6 #include <map> 7 #include <stack> 8 #include <algorithm> 9 #include <list>10 #include <ctime> 阅读全文

posted @ 2013-05-19 01:58 kakamilan 阅读(255) 评论(0) 推荐(0)

SRM 578 DIV2 DIV1
摘要:玩了二十多次,终于杀到了div1,纪念一下1、水题,求最大最小值的问题。2、话说找工作的时候有道类似的题,也是在图上遍历,然后将符合性质的点归为一类,将种类数计为n,且最少有一个,那么就是 2^n - 1种。 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 6 #include <map> 7 #include <stack> 8 #include < 阅读全文

posted @ 2013-05-03 11:20 kakamilan 阅读(343) 评论(0) 推荐(0)

SRM 574 DIV2
摘要:1、目前为止见过的最长的第一道题目了,直接计数就OK了 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 6 #include <map> 7 #include <stack> 8 #include <algorithm> 9 #include <list> 10 #include <ctime> 11 #include & 阅读全文

posted @ 2013-03-26 11:00 kakamilan 阅读(208) 评论(0) 推荐(0)

TCO 2013 1C
摘要:1、晚上一点多爬起来太痛苦了,脑子晕乎乎的,第一个都没做出来~~~~ 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 6 #include <map> 7 #include <stack> 8 #include <algorithm> 9 #include <list>10 #include <ctime>11 #incl 阅读全文

posted @ 2013-03-10 14:56 kakamilan 阅读(166) 评论(0) 推荐(0)

srm 569 div2
摘要:1、水题,直接穷举就OK了。 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 6 #include <map> 7 #include <stack> 8 #include <algorithm> 9 #include <list>10 #include <ctime>11 #include <set>12 #i 阅读全文

posted @ 2013-02-14 18:25 kakamilan 阅读(199) 评论(0) 推荐(0)

SRM 564 DIV2 DIV1
摘要:1、只要把重复出现的删掉再判断就OK了。 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <map> 6 #include <algorithm> 7 #include <stack> 8 #include <queue> 9 #include <cmath>10 using namespace std;11 class FauxPalindrome 阅读全文

posted @ 2012-12-13 16:05 kakamilan 阅读(213) 评论(0) 推荐(0)

SRM 562 DIV2
摘要:1、第一个,水题,直接求最大值即可,略。2、根据题目,clipboard最大的时候是50,则可以得到,当粘贴超过50次以后,每次增长的个数是肯定是固定个数。 写的时候为了保险,把50换到了100多。 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <map> 6 #include <algorithm> 7 #include <stack> 8 #include <q 阅读全文

posted @ 2012-12-01 15:24 kakamilan 阅读(172) 评论(0) 推荐(0)

SRM 561 DIV2 DIV1
摘要:1、水题,略。2、用到了状态压缩 注释清楚http://blog.csdn.net/hhaile/article/details/8209474#include <iostream>#include <string>#include <vector>#include <cstdlib>#include <map>#include <algorithm>using namespace std;#define INF 999999class ICPCBalloons {public: int minRepaintings(ve 阅读全文

posted @ 2012-11-22 17:04 kakamilan 阅读(298) 评论(0) 推荐(0)

SRM 556 DIV2
摘要:1、我去,这个竟然是前两天百度的面试题,不是最优就挂掉,看来面试官也在网上搜新题啊。#include <iostream>#include <queue>#include <algorithm>#include <vector>using namespace std;class ChocolateBar {public: int maxLength(string letters) { int res = 0; vector<int> last(256,-1); int l_size = letters.size(); int cur. 阅读全文

posted @ 2012-09-30 16:07 kakamilan 阅读(202) 评论(0) 推荐(0)

SRM 555 DIV2
摘要:第一次做出来第二道题,真不容易啊第一道题比较水,穷举各种情况就可以了 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 6 #include <map> 7 #include <algorithm> 8 #include <list> 9 #include <ctime> 10 #include <set> 11 #incl 阅读全文

posted @ 2012-09-08 23:43 kakamilan 阅读(183) 评论(0) 推荐(0)

SRM 553 DIV2
摘要:第三次出现二分法了,崩溃,还是当时没有想到,伤不起啊第一个很简单,解方程的题。 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 6 #include <map> 7 #include <algorithm> 8 #include <list> 9 #include <ctime>10 #include <set>11 #i 阅读全文

posted @ 2012-08-23 16:10 kakamilan 阅读(197) 评论(0) 推荐(0)

srm537 div1-3 最小费用最大流
摘要:看了很多人讲解的最小费用最大流,但是讲的都太不清楚了,感觉还是这个清楚http://www.strongczq.com/2012/03/srm537-div1-3-princexdominoes.html看了一个星期,把其中的各种变量都拆了出来,终于把最小费用最大流的各种细节明白了,我认为理解这个算法的还是理解剩余网络 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 6 #incl 阅读全文

posted @ 2012-08-17 16:46 kakamilan 阅读(367) 评论(0) 推荐(0)

SRM 552 DIV2
摘要:比较悲催,第二道题没调出来,被long long的乘法越界坑了。第一道题比较水一些,求四个矩阵中的F数目 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 6 #include <map> 7 #include <algorithm> 8 #include <list> 9 #include <ctime>10 #include < 阅读全文

posted @ 2012-08-17 15:46 kakamilan 阅读(198) 评论(0) 推荐(0)

SRM 551 DIV2
摘要:昨天晚上网络太不给力了,一言难尽啊,泪奔啊 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cmath> 5 #include <map> 6 #include <algorithm> 7 using namespace std; 8 9 int judge[100]; 10 class ColorfulBricks { 11 public: 12 int countLayouts(string bricks) { 13 i 阅读全文

posted @ 2012-08-05 13:29 kakamilan 阅读(181) 评论(0) 推荐(0)

SRM 550 DIV2
摘要:还是老样子,悲催,只做出来一个,第二个因为没有考虑一种情况,导致代码写错了第一题就是简单的比较两个字符串中不同的就OK了,最后用数字差模2比较一下就行。第二题以为可以在任意地方拐弯,实际上必须碰到边缘才可以,后来发现的时候没时间改代码了,悲催。思路就是先比较边界的情况,如果合法的话时间上就是在一个矩形中绕圈,判断一下是否合法就OK了。 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 阅读全文

posted @ 2012-07-22 14:21 kakamilan 阅读(199) 评论(0) 推荐(0)

SRM 549 DIV2
摘要:哎,水平依旧很烂,只能做出第一道很水的题。第一道题很简单,分析最初的位置,分成三种情况,仔细一点就没问题了,也算比较快的就提交了。http://community.topcoder.com/stat?c=problem_solution&rm=313696&rd=15171&pm=11964&cr=23038076第二道题比赛的时候没想清楚,比完赛之后发现了方法,其实就是二分图匹配问题,想清楚之后代码也就好写了,可惜一个小时竟然都没有想出来,要不然就是涨积分的大好时机了啊。 1 #include <iostream> 2 #include <s 阅读全文

posted @ 2012-07-09 23:47 kakamilan 阅读(253) 评论(0) 推荐(0)

topcoder&poj中学到的算法
摘要:涉及到的算法涉及到的题目链接二分法548-div2-2拓扑排序550-div2-3http://www.cnblogs.com/kakamilan/archive/2012/07/23/2605636.html概率分析537-div2-3最小费用最大流537-div1-3http://www.cnblogs.com/kakamilan/archive/2012/08/17/2644315.htmlKMP算法http://www.cnblogs.com/kakamilan/archive/2012/10/14/2723248.htmlsg函数(nim博弈游戏)561-div1-2565-div1 阅读全文

posted @ 2012-07-07 00:30 kakamilan 阅读(233) 评论(0) 推荐(0)

SRM 548 DIV2
摘要:本来早就该写的,一直拖到现在。第一题应该算是很水的题,就是数字的种类乘以某种数字出现的最大次数。http://community.topcoder.com/stat?c=problem_solution&rm=313611&rd=15170&pm=11985&cr=23038076第二题比赛期间没有想到,后来看来一下别人的,原来用二分法就可以搞定了 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 阅读全文

posted @ 2012-07-07 00:25 kakamilan 阅读(253) 评论(0) 推荐(0)

1

导航