escriptionThenthTriangularnumber,T(n) = 1 + … 
+n, is the sum of the firstnintegers. It is the number of points in a triangular 
array withnpoints on si...
                            
                            
                                分类:
其他好文   时间:
2014-05-19 19:50:24   
                                阅读次数:
191
                             
                    
                        
                            
                            
                                字符串
基本字符串操作
字符串也是序列,因此序列的基本操作(索引、分片、连接、乘法、长度、求最大值和最小值、成员资格)对字符串同样适用:
索引
>>> 'a_string'[0]
'a'
长度
>>> len('a_string')
8
求最大值
>>> max('a_string')
't'
求最小值
>>> min('a_string')
'_'
乘法
>>> ...
                            
                            
                                分类:
编程语言   时间:
2014-05-18 10:50:15   
                                阅读次数:
325
                             
                    
                        
                            
                            
                                【题目】
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly one solution.
    For example, given array S = {...
                            
                            
                                分类:
其他好文   时间:
2014-05-18 10:37:57   
                                阅读次数:
269
                             
                    
                        
                            
                            
                                【题目】
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.
Note:
Elements in a quadruplet (a,b,c,d) must be in non-descending ord...
                            
                            
                                分类:
其他好文   时间:
2014-05-18 08:46:04   
                                阅读次数:
227
                             
                    
                        
                            
                            
                                题目:给定一个数组,以及一个 target 值,target 表示目标和,要求在数组中找到两个数,xi,xj,使得 xi + xj = target。返回值是找到的两个数的下标索引,升序排序。假定至少存在一对解。
分析:对于要处理数组的问题,我们的理想状态都是给定的数组是有序的就好了,在有序后,我们就可以首位各放一个标记。类似于二分查找。
vector twoSum(vector &n...
                            
                            
                                分类:
其他好文   时间:
2014-05-18 08:04:03   
                                阅读次数:
234
                             
                    
                        
                            
                            
                                模型主要可以以两种方式进行输出:
(1)使用插件进行输出。并输出为指定的文件格式,如FBX或OBJ
(2)直接输出为响应的3D应用文件,如.max或者Blen,Unity自身再进行转换。
使用3D软件包自身格式进行输出的优缺点:
优点:(1)快速的输出工程,直接从3D文件到Unity
           (2)简单的初始化过程
缺点:(1)文件中可能会包括不需要的数据。
 ...
                            
                            
                                分类:
其他好文   时间:
2014-05-18 06:42:00   
                                阅读次数:
253
                             
                    
                        
                            
                            
                                3SumClosest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly one solution....
                            
                            
                                分类:
其他好文   时间:
2014-05-18 05:57:48   
                                阅读次数:
244
                             
                    
                        
                            
                            
                                #include 
#define MAX_TASKS 2 //任务槽个数.必须和实际任务数一至
#define MAX_TASK_DEP 12 //最大栈深.最低不得少于2 个,保守值为12.
unsigned char idata task_stack[MAX_TASKS][MAX_TASK_DEP];//任务堆栈.
unsigned char idata task_sp[MA...
                            
                            
                                分类:
其他好文   时间:
2014-05-18 05:12:43   
                                阅读次数:
339
                             
                    
                        
                            
                            
                                题目一:求1!+2!+…..+n! 的和的后6位,(注意n的范围)
#include 
using namespace std;
const int MAX = 1000000;
int getResu(int n)
{
	int sum=0;
	int temp= 1;
	for(int i=1; i <= n; i++)
	{
		temp *= i;
		temp %= MAX;
	...
                            
                            
                                分类:
其他好文   时间:
2014-05-18 03:36:19   
                                阅读次数:
223
                             
                    
                        
                            
                            
                                【题目】
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
Note:
Elements in a triplet (a,b,c) must be in non-descending order. (ie, a ≤ b ≤ c)
The so...
                            
                            
                                分类:
其他好文   时间:
2014-05-18 03:15:50   
                                阅读次数:
287