Submission #1310795

#TimeUsernameProblemLanguageResultExecution timeMemory
1310795nataliaaCave (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[i] = 1; a[ok] = ind; v[ok] =h; } answer( a,v); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:35:16: error: 'h' was not declared in this scope
   35 |         v[ok] =h;
      |                ^