Submission #71844

#TimeUsernameProblemLanguageResultExecution timeMemory
71844yusufakeCave (IOI13_cave)C++98
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #include "cave.h" int A[5003],T[5003]; vector < int > v; void exploreCave(int n) { /* ... */ int i,j,l,m,r; v.clear(); for(i=0;i<n;i++) v.pb(i); for(i=0;i<n;i++){ l = 0; r = v.size()-1; if(tryCombination(T) == i){ for(; l<r ;){ m = l+r >> 1; for(j=0;j<=m;j++) T[ v[j] ] = 1; if(tryCombination(T) > i) r = m; else l = m+1; for(j=0;j<=m;j++) T[ v[j] ] = 0; } j = v[l]; A[j] = i; T[j] = 1; } else{ for(; l<r ;){ m = l+r >> 1; for(j=0;j<=m;j++) T[ v[j] ] = 1; if(tryCombination(T) == i) r = m; else l = m+1; for(j=0;j<=m;j++) T[ v[j] ] = 0; } j = v[l]; A[j] = i; T[j] = 0; } v.erase(v.begin() + l); } answer(T,A); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:11:24: error: 'class std::vector<int>' has no member named 'pb'
     for(i=0;i<n;i++) v.pb(i);
                        ^~
cave.cpp:17:22: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
                 m = l+r >> 1;
                     ~^~
cave.cpp:29:22: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
                 m = l+r >> 1;
                     ~^~