上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页

2012年10月15日

hdu 2544 2066 1874 2680

摘要: View Code 1 #include<stdio.h> 2 #include<string.h> 3 #define maxn 110 4 #define INF 0x7ffffff 5 #define Max(a,b) a>b?a:b 6 int graph[maxn][maxn]; 7 int vis[maxn]; 8 int dis[maxn]; 9 int n,m;10 void dijkstra()11 {12 int min,now;13 memset(vis,0,sizeof(vis));14 dis[1]=0;15 vis[1]=1;16 .. 阅读全文

posted @ 2012-10-15 22:12 仁者无敌8勇者无惧 阅读(122) 评论(0) 推荐(0) 编辑

2012年10月11日

伤感!

摘要: 还是什么都不会…… 阅读全文

posted @ 2012-10-11 17:22 仁者无敌8勇者无惧 阅读(94) 评论(0) 推荐(0) 编辑

2012年10月9日

hdu 1205吃糖果

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1205水题一枚,糊里糊涂就过了!!View Code 1 #include<stdio.h> 2 int main() 3 { 4 int t; 5 int n; 6 int x,max,sum; 7 scanf("%d",&t); 8 while(t--) 9 {10 max=0;11 sum=0;12 scanf("%d",&n);13 for(int i=0;i<n;i++)14 ... 阅读全文

posted @ 2012-10-09 19:32 仁者无敌8勇者无惧 阅读(132) 评论(0) 推荐(0) 编辑

2012年9月27日

Timus 1009. K-based Numbers

摘要: View Code 1 /* 2 dp[i][0] i位数字的数首位为0 3 dp[i][1] i位数字的数首位为1 4 5 */ 6 #include<stdio.h> 7 int main() 8 { 9 int n,k;10 int dp[20][2];11 while(~scanf("%d%d",&n,&k))12 {13 dp[1][0]=1; //只有一个数字的数首位为0那就只有0一个数 14 dp[1][1]=k-1;//只有一个数字的数首位不为0 ,对于k进制就只有k-1个数,除掉0嘛 15 ... 阅读全文

posted @ 2012-09-27 21:18 仁者无敌8勇者无惧 阅读(228) 评论(0) 推荐(0) 编辑

2012年9月25日

哎……

摘要: 什么都不会…… 阅读全文

posted @ 2012-09-25 00:48 仁者无敌8勇者无惧 阅读(184) 评论(1) 推荐(0) 编辑

2012年9月12日

hdu 1178

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1178等差求和公式s=n(n+1)/2=n/2+n^2/2。。。sum=1+3+6+………………+i(i+1)(i+2)/6=1+(1+2)+(1+2+3)+…………(1+2+3+……n)=1/2+1^2/2+2/2+2^2/2+…………n/2+n^2/2=n(n+1)/2/2+n(n+1)(n+2)/6/2=n(n+1)(n+2)/6. 阅读全文

posted @ 2012-09-12 21:19 仁者无敌8勇者无惧 阅读(98) 评论(0) 推荐(0) 编辑

hdu 1999 不可摸数

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1999思路:列举1000000能组成的所有数,1000以内最后一个素数是997,s(998*998)=998+1,998*998=996004.。。 阅读全文

posted @ 2012-09-12 15:13 仁者无敌8勇者无惧 阅读(170) 评论(0) 推荐(0) 编辑

2012年9月7日

hdu 2767

摘要: View Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<vector> 4 #define N 20010 5 using namespace std; 6 int dfn[N]; 7 int low[N]; 8 int instack[N]; 9 int stack[N]; 10 int belong[N]; 11 int in[N]; 12 int out[N]; 13 int visnum; 14 int cnt; 15 int stop; 16 17 int n,m; 18 vect 阅读全文

posted @ 2012-09-07 09:38 仁者无敌8勇者无惧 阅读(190) 评论(0) 推荐(0) 编辑

2012年9月2日

hdu 1878欧拉回路

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1878View Code 1 #include<stdio.h> 2 #include<string.h> 3 int n,m; 4 int root[1002]; 5 int from[1002]; 6 int to[1002]; 7 int find(int x) 8 { 9 int res=x;10 while(x!=root[x])11 x=root[x];12 return x;13 }14 15 void merge(int x,int y)16 {17 ... 阅读全文

posted @ 2012-09-02 20:30 仁者无敌8勇者无惧 阅读(115) 评论(0) 推荐(0) 编辑

2012年9月1日

hdu 1532Drainage Ditches

摘要: Drainage DitchesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4652Accepted Submission(s): 2171Problem DescriptionEvery time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is 阅读全文

posted @ 2012-09-01 20:21 仁者无敌8勇者无惧 阅读(527) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页

导航