题目: Given an array of integers, find two numbers 
such that they add up to a specific target number. The function twoSum should 
return indices of the t...
                            
                            
                                分类:
其他好文   时间:
2014-04-30 03:20:07   
                                阅读次数:
502
                             
                    
                        
                            
                            
                                friend numbers = 2^x + 3^y -1 1 #include 2 int 
main() 3 { 4 __int64 a; 5 while(scanf("%I64d",&a)!=EOF) 6 { 7 if(!a) 8 { 
9...
                            
                            
                                分类:
其他好文   时间:
2014-04-30 01:43:36   
                                阅读次数:
322
                             
                    
                        
                            
                            
                                2014-04-29 
00:56题目:不用算数运算,完成加法。解法:那就位运算吧,用加法器的做法就可以了。代码: 1 // 18.1 add two numbers wihout 
using arithmetic operator. 2 #include 3 using namespace std....
                            
                            
                                分类:
其他好文   时间:
2014-04-29 14:58:53   
                                阅读次数:
383
                             
                    
                        
                            
                            
                                这道题也很简单,只要把二叉树按照宽度优先的策略遍历一遍,就可以解决问题,采用递归方法越是简单。下面是AC代码: 
1 /** 2 * Sum Root to Leaf Numbers 3 * 采用递归的方法,宽度遍历 4 */ 5 int result=0; 6...
                            
                            
                                分类:
其他好文   时间:
2014-04-28 10:05:40   
                                阅读次数:
682