题目如下:
Parentheses Balance 
You are given a string consisting of parentheses () and []. A string of this type is said to be correct:
(a)
    if it is the empty string 
(b)
    if A and B are ...
                            
                            
                                分类:
其他好文   时间:
2014-05-09 20:57:46   
                                阅读次数:
316
                             
                    
                        
                            
                            
                                题目如下:
Problem D: ShellSort
He made each turtle stand on another one's back
And he piled them all up in a nine-turtle stack.
And then Yertle climbed up. He sat down on the pile.
What a wonderful v...
                            
                            
                                分类:
其他好文   时间:
2014-05-09 06:20:44   
                                阅读次数:
396
                             
                    
                        
                            
                            
                                归并排序原理:
归并排序用到的是分治思想,即把一个大问题分成两个小问题,然后把一个小问题再分为两个更小的小问题,从最小的问题开始解决,然后把小问题的结果进行整合,最终解决大问题,这种思想是自顶向下的方法,特点是先进行递归,最终进行排序,在之后的快速排序中可以看到,快速排序特点是先进行排序,后进行递归...
                            
                            
                                分类:
其他好文   时间:
2014-05-09 06:15:26   
                                阅读次数:
280
                             
                    
                        
                            
                            
                                The ? 1 ? 2 ? ... ? n = k problem 
The problem
Given the following formula, one can set operators '+' or '-' instead of each '?', in order to obtain a given k
? 1 ? 2 ? ... ? n =...
                            
                            
                                分类:
其他好文   时间:
2014-05-09 06:10:40   
                                阅读次数:
285
                             
                    
                        
                            
                            
                                题目:uva :185 - Roman Numerals
题目大意:给出一个字符串的等式,问这个字符串是否是罗马等式吗?有符合的阿拉伯等式吗?前者是就输出correct or incorrect ,后者就得分情况:
ambiguous 能组成阿拉伯等式的字母组合大于等于2, valid     能组成阿拉伯等式的字母组合只有1种impossible 没有符合阿拉伯等式的字母组合。解...
                            
                            
                                分类:
其他好文   时间:
2014-05-09 06:06:02   
                                阅读次数:
329
                             
                    
                        
                            
                            
                                题目大意:给出一个范围M,然后给出若干的区间,以0 0 终止, 要求用最少的区间将0 ~M 覆盖,输出最少个数以及方案。
解题思路:典型的区间覆盖问题,算法竞赛入门经典P154上有讲。
/*author: charkj_z */
/*time: 0.108s */
/*rank: 674 */
/*为什么不把没用的地方去掉? 因为去掉了我觉得不像我能写出来的*/
/*Ac code :...
                            
                            
                                分类:
其他好文   时间:
2014-05-09 02:26:29   
                                阅读次数:
275
                             
                    
                        
                            
                            
                                /*
* uva575
* Date:2014/5/7
* State: AC
*/
#include 
#include 
#include 
#include 
#include 
using namespace std;
const int MAXN=34;
char Arr[MAXN];
int main()
{
    //cout << "Hello world!" << end...
                            
                            
                                分类:
其他好文   时间:
2014-05-09 02:25:56   
                                阅读次数:
269
                             
                    
                        
                            
                            
                                /*
* uva10879
* Date:2014/5/7
* State:AC
*/
#include 
#include 
using namespace std;
int main()
{
    //cout << "Hello world!" <>N;
...
                            
                            
                                分类:
其他好文   时间:
2014-05-09 00:30:58   
                                阅读次数:
287
                             
                    
                        
                            
                            
                                本文档下载题目:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=361 
The 3n + 1 problemTime limit: 3.000 seconds...
                            
                            
                                分类:
其他好文   时间:
2014-05-08 18:01:26   
                                阅读次数:
427
                             
                    
                        
                            
                            
                                题目链接:点击打开链接
题意:
给定一个字符串str 求字符串str的
循环节个数为 1-len 个的
最长子串长度
思路:套用kmp的性质
#include
#include
#include 
using namespace std;
#define n 1300
void getnext(char str[n],int next[n]){
	int m=strlen(str);...
                            
                            
                                分类:
其他好文   时间:
2014-05-08 17:12:53   
                                阅读次数:
330