# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
166570 | 2019-12-02T20:19:49 Z | dyd | Carnival (CEOI14_carnival) | C++14 | 0 ms | 0 KB |
#include<bits/stdc++.h> const int MAXN=200; int c[MAXN]; int party(int k,int v[]); int responde(int n){ int cur=1; for(int i=1;i<=n;i++){ if(c[i]==0){ c[i]=cur; cur++; } for(int j=i+1;j<=n;j++){ if(c[j]!=0) continue; int v[]={i,j}; int x=party(2,v); if(x==1) c[j]=c[i]; } } printf("0"); for(int i=1;i<=n;i++) printf(" %d",c[i]); return 0; }