Submission #148048

#TimeUsernameProblemLanguageResultExecution timeMemory
148048GodTeCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
void exploreCave(int N){ int ans[5010] = {0,}; int cntd[5010] = {0,}; rep(i,5010){ ans[i] = 0; cntd[i] = -1; } rep(i,N){ int l = 0; int r = N-1; while(l < r){ int mid = (l+r)/2; for(int j = l; j <= mid; j++){ if(cntd[j] == -1) ans[j] = 1-ans[j]; } if(tryCombination(ans) > i) r = mid; else { for(int j = l; j <= r; j++) if(cntd[j] == -1) ans[j] = 1-ans[j]; l = mid+1; } } cntd[l] = i; } answer(ans,cntd); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:4:6: error: 'i' was not declared in this scope
  rep(i,5010){
      ^
cave.cpp:4:2: error: 'rep' was not declared in this scope
  rep(i,5010){
  ^~~
cave.cpp:22:2: error: 'answer' was not declared in this scope
  answer(ans,cntd);
  ^~~~~~
cave.cpp:22:2: note: suggested alternative: 'ans'
  answer(ans,cntd);
  ^~~~~~
  ans