本文共 847 字,大约阅读时间需要 2 分钟。
简单博弈
代码:
#include #include #include #include #include #include #include #include #include #include using namespace std;//#pragma comment(linker,"/STACK:1000000000,1000000000")#define LL long longconst int INF=0x3f3f3f3f;const int N=1005;int head[N],I;struct node{ int j,next;}side[N*2];void Add(int i,int j){ side[I].j=j; side[I].next=head[i]; head[i]=I++;}int dfs(int x,int pre){ int k=0; for(int t=head[x];t!=-1;t=side[t].next) { int l=side[t].j; if(l==pre) continue; if(dfs(l,x)==0) { if(k==0||l >n>>s) { memset(head,-1,sizeof(head)); I=0; for(int i=1;i >l>>r; Add(l,r); Add(r,l); } int k=dfs(s,-1);; if(k) cout<<"First player wins flying to airport "< <
转载于:https://www.cnblogs.com/liulangye/archive/2012/10/18/2730079.html