Topcoder上的一道题目,题目描述如下:Problem StatementByteland is a city with many skyscrapers, so it's a perfect venue for BASE jumping. Danilo is an enthusiastic B...
分类:
编程语言 时间:
2014-08-14 20:24:39
阅读次数:
307
只要完全覆盖且不完全相同即可
#include
using namespace std;
struct RectangleCoveringEasy {
int solve(int holeH, int holeW, int boardH, int boardW) {
if((boardH>=holeH&&boardW>holeW)||(boardH>holeH&&boa...
分类:
其他好文 时间:
2014-08-13 10:32:45
阅读次数:
205
将所有密度遍历一遍求最小即可
#include
using namespace std;
struct CandyMaking {
double findSuitableDensity(vector containerVolume, vector desiredWeight) {
vectorv;
double Min=50000000;
...
分类:
其他好文 时间:
2014-08-13 10:31:55
阅读次数:
216
Problem StatementThe Happy Letter game is played as follows: At the beginning, several players enter the field. Each player has a lowercase English le...
分类:
移动开发 时间:
2014-08-13 03:33:35
阅读次数:
201
第一题是整数的方阵,求其中的子方阵,和最大。返回最大和以及子方阵宽度。因为做了topcoder的题,所以比较顺手,O(n^3)的复杂度。pair maxiSum(vector > &a) { //first is n second is sum int N = a.size(); in...
分类:
其他好文 时间:
2014-08-09 00:00:26
阅读次数:
352
http://community.topcoder.com/stat?c=problem_statement&pm=13245就是有字符串,里面的字符可以随意两两消除,如果不等的话,那么最后如果留下一个字符,这个字符就是winning letter。如果任意方法消除都是这个winning lette...
分类:
移动开发 时间:
2014-08-02 09:50:23
阅读次数:
248
目标今天听到有人说某学校的ACM队搞了一个Rating System,就是类似TopCoder和Codeforces的Rating一样,直观的积分更容易体现比赛的结果,以及大家的最近表现。而且据说他们把这个作为一个考核标准之一。听上去好赞的样子!可是我们学校木有啊!!!紧接着我就想到了当时看《社交网...
分类:
其他好文 时间:
2014-07-31 02:38:35
阅读次数:
519
小光棍数
时间限制:1000 ms | 内存限制:65535 KB
难度:1
描述 最近Topcoder的XD遇到了一个难题,倘若一个数的三次方的后三位是111,他把这样的数称为小光棍数。他已经知道了第一个小光棍数是471,471的三次方是104487111,现在他想知道第m(m<=10000000000)个小光棍数是多少?
输入有多组测试数据。第一行一个整数n,表示有...
分类:
其他好文 时间:
2014-07-29 13:09:46
阅读次数:
182
Problem StatementWe have three types of brackets: "()", "[]", and "{}". We are now interested in some special strings. A string is special if all the ...
分类:
其他好文 时间:
2014-07-29 12:41:06
阅读次数:
187
盗用名字:C题题目都没看懂, B:You are given a long longn. Return the largest divisor ofnthat is a perfect square. That is, the correct return value is x if and ...
分类:
其他好文 时间:
2014-07-29 10:54:36
阅读次数:
204