Submission #76366

#TimeUsernameProblemLanguageResultExecution timeMemory
76366SherazinCave (IOI13_cave)C++14
0 / 100
65 ms512 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; const int N = 5e3+5; int n; bitset<N> chk; int S[N], D[N]; void exploreCave(int _n) { n = _n; int t; for(int i = 0; i < n; i++) { t = tryCombination(S); bool s = (t == -1 || t > i); int l = 0, r = n-1; while(l < r) { int m = (l+r) >> 1; for(int j = l; j <= r; j++) if(!chk[j]) S[j] ^= 1; int a = tryCombination(S), e = (a == -1 || a > i); if(t ^ a) r = m; else l = m+1; } if(t == i) S[l] ^= 1; chk[l] = 1; D[l] = i; } answer(S, D); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:22:31: warning: unused variable 'e' [-Wunused-variable]
    int a = tryCombination(S), e = (a == -1 || a > i);
                               ^
cave.cpp:17:8: warning: unused variable 's' [-Wunused-variable]
   bool s = (t == -1 || t > i);
        ^
#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...