# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
70395 | Just_Solve_The_Problem | Broken Device (JOI17_broken_device) | C++11 | 59 ms | 3960 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"
//#include "grader.cpp"
#define pb push_back
using namespace std;
void Anna( int N, long long X, int K, int P[] ){
vector < int > used(N, 0);
vector < int > u(N, 0);
for (int i = 0; i < K; i++) {
used[P[i]] = 1;
}
for (int i = 0; i < N; i += 3) {
if (used[i] + used[i + 1] + used[i + 2] >= 2) continue;
if (used[i] + used[i + 1] + used[i + 2] == 1) {
if (X % 2 == 0) {
if (used[i]) {
u[i + 2] = 1;
} else if (used[i + 1]) {
u[i + 2] = 1;
} else {
u[i] = u[i + 1] = 1;
}
} else {
if (used[i]) {
if (X % 4 == 1) {
u[i + 1] = 1;
} else {
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |