Submission #102634

#TimeUsernameProblemLanguageResultExecution timeMemory
102634alexpetrescuBroken Device (JOI17_broken_device)C++14
43 / 100
62 ms3328 KiB
#include "Annalib.h" void Anna( int N, long long X, int K, int P[] ){ int poz = 0, b = 59; bool bit = 0; for (int i = 0; i < N; i++) { if (poz < K && P[poz] == i) { bit ^= 1; Set(i, 0); poz++; } else if (b >= 0 && bit == bool((1LL << b) & X)) { bit = 0; Set(i, 1); b--; } else { bit ^= 1; Set(i, 0); } } }
#include "Brunolib.h" long long Bruno( int N, int A[] ){ bool bit = 0; long long ans = 0; for (int i = 0; i < N; i++) { if (A[i] == 0) bit ^= 1; else { ans = 2 * ans + bit; bit = 0; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...