# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
102634 | alexpetrescu | Broken Device (JOI17_broken_device) | C++14 | 62 ms | 3328 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 = 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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |