Submission #1287969

#TimeUsernameProblemLanguageResultExecution timeMemory
1287969eri16Cave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
void exploreCave(int n){ int d[n],v[n]; for (int i=0; i<n; i++){ v[i]=0; } int ans,cr1,cr2; queue <int> q; for (int i=0; i<n; i++){ q.push(i); } int tt=0; while (ans!=(-1) && tt<=80000){ tt++; cr1=tryCombination(v); for (int i=0; i<q.size(); i++){ int tm=q.front(); q.pop(); v[tm]=1; cr2=tryCombination(v); if (cr2==cr1){v[tm]=0;q.push(tm);} else{ if (cr1<cr2 || cr2==-1){d[tm]=cr1;break;} if (cr2<cr1){v[tm]=0;d[tm]=cr2;break;} } } } answer(v,d); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:11:5: error: 'queue' was not declared in this scope
   11 |     queue <int> q;
      |     ^~~~~
cave.cpp:11:12: error: expected primary-expression before 'int'
   11 |     queue <int> q;
      |            ^~~
cave.cpp:14:9: error: 'q' was not declared in this scope
   14 |         q.push(i);
      |         ^
cave.cpp:19:13: error: 'tryCombination' was not declared in this scope
   19 |         cr1=tryCombination(v);
      |             ^~~~~~~~~~~~~~
cave.cpp:21:25: error: 'q' was not declared in this scope
   21 |         for (int i=0; i<q.size(); i++){
      |                         ^
cave.cpp:36:5: error: 'answer' was not declared in this scope
   36 |     answer(v,d);
      |     ^~~~~~