Submission #991613

#TimeUsernameProblemLanguageResultExecution timeMemory
991613yeediotCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; void exploreCave(int n){ int s[n], d[n], cur[n]; bool done[n]; memset(done, 0, sizeof(done)); memset(cur, 0, sizeof(cur)); for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(!done[j]){ cur[j] ^= 1; } } int pos = tryCombination(cur); bool flag = 0; if(pos > i){ flag = 1; } int l = 0, r = n-1; while(l < r){ int mm = l+r >> 1; for(int j=l;j<=mm;j++){ if(!done[j]) cur[j] = flag; } pos = tryCombination(cur); for(int j=l;j<=mm;j++){ if(!done[j]) cur[j] = !flag; } if(pos > i) { r = mm; } else{ l = mm+1; } } d[i] = l; s[i] = flag; done[l] = 1; } answer(d, s); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:14:19: error: 'tryCombination' was not declared in this scope
   14 |         int pos = tryCombination(cur);
      |                   ^~~~~~~~~~~~~~
cave.cpp:21:23: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   21 |             int mm = l+r >> 1;
      |                      ~^~
cave.cpp:40:5: error: 'answer' was not declared in this scope
   40 |     answer(d, s);
      |     ^~~~~~