# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
753500 | piOOE | Broken Device (JOI17_broken_device) | C++17 | 41 ms | 2792 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"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll Y = 439789002196527822LL;
void Anna(int N, long long X, int K, int P[]) {
vector<int> a(N), used(N);
X ^= Y;
for (int i = 0; i < K; ++i) {
used[P[i]] = true;
}
for (int i = 0, b = 0; i < N; ++i) {
if (!used[i] && (X >> b & 1) == (i & 1)) {
a[i] = 1;
b += 1;
}
}
for (int i = 0; i < N; i++) {
Set(i, a[i]);
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll Y = 439789002196527822LL;
long long Bruno(int N, int A[]) {
ll X = 0;
for (int i = 0, b = 0; i < N; ++i) {
if (A[i]) {
X |= (i & 1LL) << b;
b += 1;
}
}
X ^= Y;
return X;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |