uva11584:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2631题意:给你一个串,问你这个串最少被划分成多少个子串,才能使得每个子串都是回文子串。题...
分类:
其他好文 时间:
2014-07-03 21:52:42
阅读次数:
237
UVALive:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1504题意:给你一个长度为L的盒子,然后有n个物品,然后给出每个物品的长度,...
分类:
其他好文 时间:
2014-07-03 20:36:08
阅读次数:
250
Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution stil...
分类:
其他好文 时间:
2014-07-03 20:34:46
阅读次数:
193
/************************************************************** Problem: 3203 User: wangyucheng Language: C++ Result: Accepted Time:344...
分类:
其他好文 时间:
2014-07-03 18:50:41
阅读次数:
212
题目如下:
Problem D: XYZZY
ADVENT: /ad?vent/, n.
The prototypical computer adventure game, first designed by Will Crowther on the PDP-10 in the mid-1970s as an attempt at computer-refereed fantasy...
分类:
其他好文 时间:
2014-07-03 18:09:47
阅读次数:
211
题目:把1-n,连续的放到一个环里,使相邻的数字和为素数,输出所有结果。
分析:搜索+剪枝。如果裸搜,用dancing-links那种拆装的链表,应该差不多满足16的数据量。
这里利用一个性质进行剪枝:相邻的数字一定是奇偶性不同的数字。
(如果上述假设不成立,则存在相邻的奇数或偶数,那么他们的和一定是大于2的偶数,不是素数)
...
分类:
其他好文 时间:
2014-07-03 17:45:19
阅读次数:
204
同样的一个源码, 如果保存成c文件, 用gcc编译可以通过和使用
如果用g++编译无法通过. 原因是abs() 函数无法找到?
1992829.101983/Main.cc: In function ‘int main()’:
1992829.101983/Main.cc:11:32: error: ‘abs’ was not declared in this scope
#inclu...
分类:
其他好文 时间:
2014-07-03 16:52:19
阅读次数:
271
题意:题意:给你3个字符串s1,s2,s3;要求对三个字符串中的字符赋值(相同的字符串进行相同的数字替换),
替换后的三个数进行四则运算要满足左边等于右边,求有几种解法。
Sample Input
2
A A A
BCD BCD B
Sample Output
5
72
eg:ABBDE ABCCC BDBDE ;...
分类:
其他好文 时间:
2014-07-02 16:59:34
阅读次数:
242
JAVA大数....
字串数
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 2893 Accepted Submission(s): 679
Problem Description
一个A和两个B...
分类:
其他好文 时间:
2014-07-02 16:43:57
阅读次数:
194
Pick-up sticks
Problem Description
Stan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan tries to find the top sticks,...
分类:
其他好文 时间:
2014-07-02 15:29:53
阅读次数:
295