Submission #511103

#TimeUsernameProblemLanguageResultExecution timeMemory
511103bebecanvasCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include "cave.h" #include <queue> void exploreCave(int N) { int d[N]; int s[N]; for(int i=0; i<N; i++){s[i]=0;} std::queue<int> q; for(int i=0; i<N; i++){ q.push(i); } int prev= tryCombination(s); while(!q.empty()){ int a= q.top(); q.pop(); s[a]++; s[a]%=2; int b= tryCombination(s); if(b==prev){q.push(a);} else if(b>prev&&prev!=-1){ d[a]= prev; prev= b; }else{ d[a]= b; s[a]++; s[a]%=2; } } answer(s, d); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:16:12: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'?
   16 |   int a= q.top(); q.pop();
      |            ^~~
      |            pop