随笔分类 -  hdu

摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3572#include <stdio.h>#include <string.h>#include <algorithm>using namespace std;const int MAXN = 3000;const int MAXM = 210000;const int INF =0x7ffffff;struct Edge{ int st, ed; int next; int flow;}edge[MAXM];int head[MAXN];int n,m,S,T,tot,d 阅读全文
posted @ 2012-08-14 19:14 forgood 阅读(269) 评论(0) 推荐(0)
摘要:Problem Descriptionhttp://acm.hdu.edu.cn/showproblem.php?pid=1072Ignatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should get out of the labyrinth before the bomb explodes. The initial exploding time of the bomb is set t 阅读全文
posted @ 2012-04-17 00:53 forgood 阅读(174) 评论(0) 推荐(0)
摘要:#include<iostream>using namespace std;int main(){int m,n;while(cin>>n>>m){if(n==0&&m==0) break;if(n*m%2==0) cout<<"Wonderful!"<<endl;else cout<<"What a pity!"<<endl;}return 0;}水果了,找规律 阅读全文
posted @ 2011-10-12 20:57 forgood 阅读(139) 评论(0) 推荐(0)
摘要:看了这篇文章对初入博弈论很有用http://www.wutianqi.com/?p=1081#include<iostream>using namespace std;int a[50];int main(){int n,t,i,flag,cnt;cin>>t;while(t--){cin>>n;flag=0; cnt=0;for(i=0;i<n;i++){cin>>a[i];flag=flag^a[i];if(a[i]>1) cnt++;}if(flag!=0){if(cnt>=1) cout<<"Joh 阅读全文
posted @ 2011-10-10 23:11 forgood 阅读(231) 评论(0) 推荐(0)
摘要:#include<iostream>using namespace std;int f[32770];int main(){ int i,j,n; f[0]=1; for(i=1;i<=3;i++) for(j=i;j<=32768;j++) f[j]+=f[j-i]; while(scanf("%d",&n)==1) { printf("%d\n",f[n]); } return 0;} 阅读全文
posted @ 2011-10-02 23:11 forgood 阅读(115) 评论(0) 推荐(0)