遇到的问题:input{1,1,1}, output{1,1}, expected{1}, 
原因在于若temp.val==temp.next.val, 则需要temp.next=temp.next.next, 
这时候就不要temp=temp.next了注意停止条件不光是temp!=null,还应该有...
                            
                            
                                分类:
其他好文   时间:
2014-05-05 22:47:08   
                                阅读次数:
454
                             
                    
                        
                            
                            
                                很锻炼DP/recursive思路的一道题,个人感觉DP/recursive算是比较难写的题目了。这道题解法的巧妙之处在于巧用-1,并且使用临时存储,节省了很多开支。这道题同时也在Career 
Cup上面出现过这道题我两次调试通过,第一次错是因为input{}, output false, expe...
                            
                            
                                分类:
其他好文   时间:
2014-05-05 22:45:10   
                                阅读次数:
352
                             
                    
                        
                            
                            
                                骨牌铺方格在1×n的一个长方形方格中,用1×1、1×2、1×3的骨牌铺满方格,输入n 
,输出铺放方案的总数。 例如n=3时,为1× 
3方格,骨牌的铺放方案有四种,如下图:Input输入数据由多行组成,每行包含一个整数n,表示该测试实例的长方形方格的规格是1×nOutput对于每个测试实例,请输出铺放...
                            
                            
                                分类:
其他好文   时间:
2014-05-05 22:35:41   
                                阅读次数:
659
                             
                    
                        
                            
                            
                                拼图Time Limit:1000MSMemory 
Limit:65535KBSubmissions:117Accepted:69Description给你1x2、2x1和2x2,3种矩形若干,请你计算出把它们放入2xn的矩形中,一共有多少方法?Input输入有多组测试数据没行输入一个整数n 
, 3...
                            
                            
                                分类:
其他好文   时间:
2014-05-05 22:35:15   
                                阅读次数:
435
                             
                    
                        
                            
                            
                                A × B problem
Time Limit: 1000 ms   Case Time Limit: 1000 ms   Memory Limit: 64 MB
Total Submission: 594   Submission Accepted: 112 
Description
给你两个整数,请你计算A × B。
Input
数据的第一行是整数T(1 ≤ T ≤ 20...
                            
                            
                                分类:
其他好文   时间:
2014-05-05 13:05:38   
                                阅读次数:
301
                             
                    
                        
                            
                            
                                Input
t – the number of numbers in list, then t lines follow [t 
Each line contains one integer: N [0 N 
Output
Output given numbers in non decreasing order.
Example
Input:
5
5
3
...
                            
                            
                                分类:
其他好文   时间:
2014-05-04 00:04:09   
                                阅读次数:
376
                             
                    
                        
                            
                            
                                1、文本框获得(失去)焦点
当文本框获得输入焦点时,将该文本框高亮显示,算不得一个应用,只是一个小技巧,可以提高用户体验。
body{
	font:normal 12px/17px Arial;
}
div{
    padding:2px;
} 
input, textarea { 
	 width: 12em; 
	 border: 1px solid #888;
}
.f...
                            
                            
                                分类:
Web程序   时间:
2014-05-03 17:00:57   
                                阅读次数:
456
                             
                    
                        
                            
                            
                                【题目】
B
Age Sort
Input: Standard Input
Output: Standard Output
 
You are given the ages (in years) of all people of a country with at least 1 year of age. You kn...
                            
                            
                                分类:
其他好文   时间:
2014-05-03 16:51:42   
                                阅读次数:
427
                             
                    
                        
                            
                            
                                本题就是测试读入数据的速度的。
如果有大量的数据读入,使用cin是很慢的。
那么使用scanf那么会快很多,但是如果数据量更大的话那么就还是不够快了。
所以这里使用fread。
首先开一个buffer,然后使用fread大块大块地读入数据就可以非常快地读入了。
题目如下:
Input
The input begins with two positive...
                            
                            
                                分类:
其他好文   时间:
2014-05-03 16:13:21   
                                阅读次数:
340
                             
                    
                        
                            
                            
                                把一般式子转换成逆波兰式。
这里的都是加括号的,难度降低点。
Example
Input:
3
(a+(b*c))
((a+b)*(z+x))
((a+t)*((b+(a+c))^(c+d)))
Output:
abc*+
ab+zx+*
at+bac++cd+^*
知道其特点就好办:
1 遇到字母一定是可以输出的
2 遇到操作符号就入栈
3 遇到括号')',就出栈...
                            
                            
                                分类:
其他好文   时间:
2014-05-03 15:35:28   
                                阅读次数:
317