Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
哪位牛人帮忙看看什么地方错了#include<stdio.h> #include<iostream.h> #include<string> int g3[27],p[27]={0}; int l=1,v=0; char c[1000000]; int yx1(int now,int g1[27][27]) { int i; int t; for(i=0;i<26;i++) { if(g1[i][now]&&!g3[i]) { g3[i]=1; t=p[i]; p[i]=now; if(t==0||yx1(t,g1)) return 1; p[i]=t; } } return 0; } int yx2(int v1,int g1[27][27]) { int i,num; num=0; memset(p,0,sizeof(p)); for(i=1;i<v1;i++) { memset(g3,0,sizeof(g3)); if(yx1(i,g1)) { num++; } } return num; } int yx3(char c[]) { int i,j,k,t,s; int h; k=1; t=1; v++; if(c[0]=='>') { if(v==1) l=0; return 1; } int g1[27][27]; memset(g1,0,sizeof(g1)); while(1) { gets(c); if(c[0]=='>') { break; } i=1; if(c[0]=='<') { t=yx3(c); if(t==0) l=0; } else { for(j=0;j<strlen(c);j++) { if(c[j]>='A'&&c[j]<='Z') { h=(int)(c[j]-'A'); g1[k][h]=1; g1[h][k]=1; i++; } } k++; } if(k>=30) { t=0; l=0; } } if(k==1) { l=0; return 0; } else if(t!=0) { s=yx2(k,g1); if(s==k-1) return 1; else { l=0; return 0; } } else { l=0; return 0; } } int main() { int z; gets(c); z=yx3(c); if(l==0) cout<<"No Solution\n"; if(l==1) cout<<"Got It!\n"; return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator