Submission #870055

#TimeUsernameProblemLanguageResultExecution timeMemory
870055AtabayRajabliCave (IOI13_cave)C++17
0 / 100
17 ms600 KiB
#include "cave.h" void exploreCave(int n) { int q = 0; int a[n], ans[n], d[n]; for(int i = 0; i<n; i++) { a[i] = 0; } int l, r, mid; for(int i = 0; i<n; i++) { l = 0, r = n-1; while(l <= r) { mid = (l + r) / 2; for(int i = mid; i<=r; i++)a[i] ^= 1; int q = tryCombination(a); if(q == i)l = mid + 1; else r = mid - 1; } d[mid] = i; ans[i] = a[mid]; } answer(a, d); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:4:9: warning: unused variable 'q' [-Wunused-variable]
    4 |     int q = 0;
      |         ^
cave.cpp:5:15: warning: variable 'ans' set but not used [-Wunused-but-set-variable]
    5 |     int a[n], ans[n], d[n];
      |               ^~~
#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...