http://acm.hdu.edu.cn/showproblem.php?pid=1518
Square
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 8343 Accepted Submission(s): 270...
分类:
其他好文 时间:
2014-07-26 17:14:32
阅读次数:
254
题意:给你n根棍子跟它的边长,要你能用这些棍子组一个正方形
思路:回溯法
能组正方形条件:
1、棍子总长%4要等于0
2、不能出现棍子的长度大于正方形的边长
3、棍子数大于等于4
直接用回溯肯定会超时,所以我们需要来优化空间了
1、对于已使用的边,不能在它的子树中使用
2、由于题目是判断能不能组正方形,所以只要满足了条件,就直接结束!
所以AC代码:
#include
#in...
分类:
其他好文 时间:
2014-07-26 02:57:46
阅读次数:
226
Square
Time Limit : 10000/5000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)
Total Submission(s) : 11 Accepted Submission(s) : 5
Font: Times New Roman | Verdana | Georgia
Font Siz...
分类:
其他好文 时间:
2014-07-26 02:27:46
阅读次数:
252
Square Coins
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 7995 Accepted Submission(s): 5416
Problem Description
People in Sil...
分类:
其他好文 时间:
2014-07-26 02:18:26
阅读次数:
183
Square Coins Time Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64u ...
分类:
其他好文 时间:
2014-07-26 01:11:36
阅读次数:
273
Square Country
大意: 买一块边长为 a 的正方形地需要的钱数是 a^2, 现在输入N为钱的数目,求最少购买地的块数可以凑够N。
思路:DP,由背包思想推出来的dp[i] = min(dp[i], dp[j-i*i]+1); 方块都是由正方形组成的,所以是i*i,循环的时候也是i*i。
#include
#define min(a, b)...
分类:
其他好文 时间:
2014-07-25 11:06:21
阅读次数:
195
(一)2014-07-24向那些疯狂的家伙们致敬Here's to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes.The ones who see thin...
分类:
其他好文 时间:
2014-07-25 02:39:44
阅读次数:
250
来自IOS7 by tutorials 下面是个人的一点翻译总结 1,首先在初始化方法李画一个方块UIView* square = [[UIViewalloc]initWithFrame:CGRectMake(100,100,100,100)];square.backgroundColor= [.....
分类:
移动开发 时间:
2014-07-24 14:35:35
阅读次数:
301
题目链接:点击打开链接
白书的例题练练手。。。P161
#include
#include
#include
#include
#include
#include
using namespace std;
#define ll int
#define LL long long
const int mod = 1000000009;
const int maxn = 510;
con...
分类:
其他好文 时间:
2014-07-23 17:19:01
阅读次数:
268
android 下Protobuff常用的框架有三个: protobuff自身, square出的wire , protostuff由于protobuff会为每个属性生成大量不常用的方法,当程序比较复杂时容易超过android的60K个方法的上限, 所以本次测试未包括protobuff测试逻辑是循环...
分类:
移动开发 时间:
2014-07-23 11:59:56
阅读次数:
414