# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
923154 | gawr_gura | Broken Device (JOI17_broken_device) | C++17 | 32 ms | 2836 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 <bits/stdc++.h>
#include "Annalib.h"
using namespace std;
void Anna(int N, long long X, int K, int P[]) {
vector<int> a(N);
vector<int> wrong(N);
for (int i = 0; i < K; i++) wrong[P[i]] = 1;
for (int i = 0; i < N / 2; i++) {
if (wrong[i] || wrong[i + N / 2]) {
Set(i, 0), Set(i + N / 2, 0);
} else {
int z = X % 3;
X /= 3;
if (z == 0) Set(i, 1), Set(i + N / 2, 1);
if (z == 1) Set(i, 0), Set(i + N / 2, 1);
if (z == 2) Set(i, 1), Set(i + N / 2, 0);
}
}
}
#include <bits/stdc++.h>
#include "Brunolib.h"
using namespace std;
long long Bruno(int N, int A[]) {
int64_t X = 0;
for (int i = N / 2 - 1; i >= 0; i--) {
if (A[i] == A[i + N / 2]) {
if (A[i] == 0) continue;
if (A[i] == 1) X *= 3;
} else {
X *= 3;
if (A[i] == 0) X += 1;
if (A[i] == 1) X += 2;
}
}
return X;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |