Submission #1310797

#TimeUsernameProblemLanguageResultExecution timeMemory
1310797nataliaaCave (IOI13_cave)C++20
Compilation error
0 ms0 KiB
//#include "cave.h" #include<bits/stdc++.h> using namespace std; void exploreCave(int N) { int v[N]={}; int a[N] ={}; int vis[N]={}; for(int i = 0; i < N; i++) { for(int j =0; j < N; j++) { if(vis[j]==0) a[j] = 0; } int ind = 0; int k = tryCombination(a); if(k==i) ind = 1; for(int j =0; j < N; j++) { if(vis[j]==0) a[j] = 1-ind; } int ok; int l = 0, r= N-1; while(l<r) { int m = (l+r)/2; for(int j =l; j <= m; j++) { if(vis[j]==0) a[j] = ind; } k = tryCombination(a); for(int j =l; j <= m; j++) { if(vis[j]==0) a[j] = 1-ind; } if(k!=i) {r = m; ok = r;} else {l=m+1; ok = l;} } vis[ok] = 1; a[ok] = ind; v[ok] =i; } answer( a,v); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:13:17: error: 'tryCombination' was not declared in this scope
   13 |         int k = tryCombination(a);
      |                 ^~~~~~~~~~~~~~
cave.cpp:37:6: error: 'answer' was not declared in this scope
   37 |      answer( a,v);
      |      ^~~~~~