Submission #1099714

#TimeUsernameProblemLanguageResultExecution timeMemory
1099714NinedesuCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; void exploreCave(int N){ vector<int>test(N),lock(N),pos(N),D(N); for(int i=0; i<N; i++){ lock[i] = -1; } for(int i=0; i<N; i++){ int thisans; for(int j=0; j<N; j++){ if(lock[j]!=-1)test[j] = lock[j]; else test[j] = 0; } int door = tryCombination(test); thisans = (door == i); int l=0,r=N-1; while(l<r){ int mid=(l+r)/2; for(int j=i; j<=mid; j++){ if(lock[j]!=-1)test[j] = lock[j]; else test[j] = 0; } for(int j=mid+1; j<=r; j++){ if(lock[j]!=-1)test[j] = lock[j]; else test[j] = 1; } door = tryCombination(test); if(door > i){ if(!thisans){ r=mid; } else{ l=mid+1; } } else{ if(!thisans){ l=mid+1; } else{ r=mid; } } } pos[i]=l; lock[l]=thisans; } for(int i=0; i<N; i++){ D[pos[i]]=i; } answer(lock,D); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:15:20: error: 'tryCombination' was not declared in this scope
   15 |         int door = tryCombination(test);
      |                    ^~~~~~~~~~~~~~
cave.cpp:52:5: error: 'answer' was not declared in this scope
   52 |     answer(lock,D);
      |     ^~~~~~