码迷,mamicode.com
首页 >  
搜索关键字:topcoder    ( 349个结果
topcoder SRM 618 DIV2 MovingRooksDiv2
一开始Y1,Y2两个参数看不懂,再看一遍题目后才知道,vector索引代表是行数,值代表的是列此题数据量不大,直接深度搜索即可注意这里深度搜索的访问标识不是以前的索引和元素,而是一个交换元素后的整个状态vector,这样可以避免重复元素的搜索 set > visit; bool flag...
分类:其他好文   时间:2014-06-17 14:05:10    阅读次数:203
topcoder SRM 618 DIV2 WritingWords
只需要对word遍历一遍即可 int write(string word) { int cnt = 0; for(int i = 0 ; i < word.length(); ++ i){ cnt+=word[i]-'A'+1; ...
分类:其他好文   时间:2014-06-17 14:01:50    阅读次数:206
topcoder SRM 624 DIV2 CostOfDancing
排个序,求前k个元素和即可 int minimum(int K, vector danceCost) { sort(danceCost.begin(),danceCost.end()); return accumulate(danceCost.begin()...
分类:其他好文   时间:2014-06-15 21:53:14    阅读次数:201
topcoder SRM 624 DIV2 BuildingHeightsEasy
从大到小遍历一遍,每次取M个元素,然后求得最小的floor即可 int minimum(int M, vector heights) { sort(heights.begin(),heights.end()); int minFloor = 10000; ...
分类:其他好文   时间:2014-06-15 21:48:45    阅读次数:229
topcoder SRM 522 DIV2 FibonacciDiv2
关于斐波那契数列,由于数据量比较小, 直接打表了,代码写的比较戳#include #include #include using namespace std;class FibonacciDiv2{public: vector table; void make_table(){ ...
分类:其他好文   时间:2014-06-06 13:18:11    阅读次数:305
topcoder SRM 522 DIV2 BoxesDiv2
注意题目这句话,Once you have each type of candies in a box, you want to pack those boxes into larger boxes, until only one box remains.两个box合并后必须放入更大一个盒子题目的有...
分类:其他好文   时间:2014-06-06 13:09:50    阅读次数:213
topcoder srm: NumbersChallenge
用bit mask来做枚举还挺方便的这个大概是给你一个vector array,求出这个array里任意几个元素加和所不能得到最小的整数。元素个数最大20个,每个元素不超过100000比如[1,2,4],那么就应该返回8. (因为3=1+1, 5=1+4等等)所以枚举这个array的所有子集求和,之...
分类:其他好文   时间:2014-06-05 17:25:52    阅读次数:246
Topcoder SRM 619 DIv2 500 --又是耻辱的一题
这题明明是一个简单的类似约瑟夫环的问题,但是由于细节问题迟迟不能得到正确结果,结果比赛完几分钟才改对。。耻辱。代码:#include #include #include #include #include #define ll long longusing namespace std;#define...
分类:其他好文   时间:2014-05-07 17:35:47    阅读次数:290
nyoj 对决
/*对决时间限制:1000 ms | 内存限制:65535 KB 难度:0描述 Topcoder要招进来了 n 个新同学,Yougth计划把这个n个同学分成两组,要求每组中每个人必须跟另一组中每个同学进行一次算法对决,问存不存在一种分组方式在k场完成对决。(两组中每一组中人数都要大于0)输入有多组测...
分类:其他好文   时间:2014-05-05 09:58:43    阅读次数:527
349条   上一页 1 ... 33 34 35
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!