Submission #71847

#TimeUsernameProblemLanguageResultExecution timeMemory
71847yusufakeCave (IOI13_cave)C++98
13 / 100
819 ms640 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.push_back(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: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;
                     ~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...