#includevoid BubbleSort(int n,int a[]){ for(int i=0;ia[j+1]) { int tmp=a[j]; a[j]=a[j+1]; a...
分类:
其他好文 时间:
2014-07-26 13:49:14
阅读次数:
175
就是练个手,白皮书的小东西。原题是要写N!/(M!*(N-M)!)他是先写F(n)的N!然后F(N)/(F(M)*F(N-M))但是这样会溢出。改一下,主要是习惯MAIN()外写函数然后调用#includeint f(int n,int m){int i,sum=1;for(i=n-m;i>0;i+...
分类:
其他好文 时间:
2014-07-26 13:48:55
阅读次数:
224
题目:Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.题解:这道题可以应用之前解过的Largetst Recta....
分类:
编程语言 时间:
2014-07-26 09:55:57
阅读次数:
301
题目:Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.题解:Merge k sorted linked list就是merge 2 sorted li....
分类:
编程语言 时间:
2014-07-26 05:44:37
阅读次数:
304
pointExchangeLocalServiceImpl.java加入的代码/***积分管理中的查询方法**@paramsearchTerms*@paramcompanyId*@paramgroupId*@paramstart*@paramend*@return*@throwsSystemException*///查询PointExchange表中所有记录@SuppressWarnings("unchecked")publicList<PointExcha..
分类:
其他好文 时间:
2014-07-26 03:28:17
阅读次数:
163
pointExchangeLocalServiceImpl.java加入的代码/***积分管理中的查询方法**@paramsearchTerms*@paramcompanyId*@paramgroupId*@paramstart*@paramend*@return*@throwsSystemException*///查询PointExchange表中所有记录@SuppressWarnings("unchecked")publicList<PointExcha..
分类:
其他好文 时间:
2014-07-26 03:27:57
阅读次数:
972
1.CMap.
UINT AFXAPI HashKey(CString& string)
{
LPCTSTR key=(LPCTSTR)string;
UINT nHash=0;
while(*key)
{
nHash=(nHash<<5)+nHash+*key++;
}
return nHash;
}
int main()
{
CMap CMapS...
分类:
其他好文 时间:
2014-07-26 03:03:07
阅读次数:
260
// 清除thin pool
1.1 func (d *Driver) Cleanup() error {
// 停止thin pool
err := d.DeviceSet.Shutdown()
return err
}
// 当加载新镜像时,添加一个新thin device
// id为containerid或imageid
1.2 func (d *Driver) Create(i...
分类:
移动开发 时间:
2014-07-26 02:59:46
阅读次数:
302
1. 类模板的 static 成员[不同于C#中的static]
类模板可以像任意其他类一样声明static 成员。以下代码:
template class Foo {
public:
static std::size_tcount() { return ctr; }
// other interfacemembers
private:
static std::size_tct...
分类:
编程语言 时间:
2014-07-26 02:42:56
阅读次数:
242
注意数组的大小,以及字符的输入问题
#include
#include
int dp[4000000],a[4],money[400];
char s[120];
double str[120];
int max(int a,int b)
{return a>b?a:b;}
int main()
{
int N,sum,ans,ok,count,i,j,num;
double Q...
分类:
其他好文 时间:
2014-07-26 02:38:26
阅读次数:
253