# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
102638 | alexpetrescu | Broken Device (JOI17_broken_device) | C++14 | 134 ms | 3072 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "Annalib.h"
void Anna( int N, long long X, int K, int P[] ){
int poz = 0, b = 59;
bool bit = 1;
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)) {
Set(i, 1);
b--;
} else {
bit ^= 1;
Set(i, 0);
}
}
}
#include "Brunolib.h"
long long Bruno( int N, int A[] ){
bool bit = 1;
long long ans = 0;
for (int i = 0; i < N; i++) {
if (A[i] == 0)
bit ^= 1;
else
ans = 2 * ans + bit;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |