上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 25 下一页

2011年8月16日

poj 1200 crazy search Hash

摘要: Problem:1200User:sunyanfeiMemory:30904KTime:63MSLanguage:G++Result:AcceptedSource Code/* * Author:lonelycatcher * Problem:poj 1200 crazy search * Type:Hash */#include <iostream>#include<string>#include<string.h>#include<stdio.h>using namespace std;char str[1000000];int hash[1 阅读全文

posted @ 2011-08-16 16:08 lonelycatcher 阅读(247) 评论(0) 推荐(0) 编辑

2011年8月15日

poj 1020 DFS +回溯

摘要: Source CodeProblem:1020User:sunyanfeiMemory:700KTime:32MSLanguage:G++Result:AcceptedSource Code/* * Problem:poj 1020 zoj 1411 * Type:DFS+回溯 */#include <iostream>#include<stdio.h>#include<string.h>using namespace std;int cake_size,cake_number,cuted_cakes;//cute_cakes是已经放好的蛋糕数int pie 阅读全文

posted @ 2011-08-15 20:42 lonelycatcher 阅读(298) 评论(0) 推荐(0) 编辑

2011年8月2日

poj 1564

摘要: Source Code/* * Author:lonelycatcher * problem:ZOJ 1711 * Type: DFS */#include<iostream>#include<stdio.h>#include<queue>#include<string>#include<string.h>using namespace std;int t,n;struct node{ int data; int preindex;};node lis[15];int OK,count;void printpath(int index 阅读全文

posted @ 2011-08-02 23:00 lonelycatcher 阅读(344) 评论(0) 推荐(0) 编辑

2011年8月1日

HDU 1041 递推 大数

摘要: 递推:0->10 ; 1->01; 00->1010; 10->0110; 01->1001; 11->0101;假设a[i]表示第i 步时候的00的个数,由上面的可以看到,00是由01 得到的,所以只要知道a[i-1]的01的个数就能够知道a[i]的00的个数了,那a[i-1]怎么求呢,同样看推导,01由1和00 得到,而第i步1的个数是2^(i-1),所以a[i]=2^(i-3)+a[i-2];大数的话用java比较方便,用C++效率高点import java.io.*;import java.math.*;import java.util.*;publ 阅读全文

posted @ 2011-08-01 22:32 lonelycatcher 阅读(228) 评论(0) 推荐(0) 编辑

HDU 1040 排序 大水题一道

摘要: /* * Author:lonelycather * problem:hdu 1040 * Type:简单排序 */#include<stdio.h>#include <iostream>#include<algorithm>using namespace std;int cmp(const void* a,const void* b){ return *(int*)a-*(int*)b;}int N;int sequence[1000];int main(){ int T,i; cin>>T; while(T--) { cin>>N 阅读全文

posted @ 2011-08-01 15:39 lonelycatcher 阅读(334) 评论(0) 推荐(0) 编辑

上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 25 下一页

导航