Submission #145069

#TimeUsernameProblemLanguageResultExecution timeMemory
145069youssefbou62Cave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include <cave.h> using namespace std; int n , door[5005] , Comb[5005] ; void rev(int l , int r ){ for(;l<=r;l++)if(door[l]!=-1)Comb[i]=!Comb[i]; } void findDoor(){ int l =0 , r = n-1 ; int start = tryCombination(Comb); while (l<r && start != -1 ){ int mid = (l+r)/2 ; Rev(l,mid); int rep = tryCombination(Comb); Rev(l,mid); if( rep == start )l=mid+1; else r = mid ; } assert(l==r||start==-1); door[l]=start; } void exploreCave(int N){ memset(door,-1,sizeof door); for(int i = 0 ; i < N ; i++ ){ findDoor(); } for(int i = 0 ; i< N ; i++ ){ if( door[i]==-1){ rev(i,i); door[i]=tryCombination(Comb); rev(i,i); } } answer(Comb,door); }

Compilation message (stderr)

cave.cpp: In function 'void rev(int, int)':
cave.cpp:9:39: error: 'i' was not declared in this scope
     for(;l<=r;l++)if(door[l]!=-1)Comb[i]=!Comb[i];
                                       ^
cave.cpp: In function 'void findDoor()':
cave.cpp:17:9: error: 'Rev' was not declared in this scope
         Rev(l,mid);
         ^~~
cave.cpp:17:9: note: suggested alternative: 'rev'
         Rev(l,mid);
         ^~~
         rev