제출 #67179

#제출 시각아이디문제언어결과실행 시간메모리
67179Vahan동굴 (IOI13_cave)C++17
100 / 100
1135 ms644 KiB
#include "cave.h" int s[2][6000][6000],n,a[6000],x[6000],y[6000],o[6000],z[6000]; int bin(int l,int r,int u,int q) { if(l==r) return l; int mid=(l+r)/2; for(int i=0;i<n;i++) { if(i>=l && i<=mid) a[i]=q; else a[i]=1-q; } for(int i=0;i<u;i++) a[x[i]]=y[i]; int t=tryCombination(a); if(t==-1 || t>u) bin(l,mid,u,q); else bin(mid+1,r,u,q); } void exploreCave(int N) { n=N; for(int i=0;i<n;i++) { for(int j=0;j<n;j++) a[j]=0; for(int j=0;j<i;j++) a[x[j]]=y[j]; int t=tryCombination(a); if(t==-1 || t>i) y[i]=0; else y[i]=1; x[i]=bin(0,n-1,i,y[i]); o[x[i]]=i; z[x[i]]=y[i]; } answer(z,o); }

컴파일 시 표준 에러 (stderr) 메시지

cave.cpp: In function 'int bin(int, int, int, int)':
cave.cpp:22:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...