# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
869604 | rxlfd314 | Navigation 2 (JOI21_navigation2) | C++17 | 537 ms | 2424 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 "Anna.h"
#include <bits/stdc++.h>
using namespace std;
#define vt vector
#define size(x) (int((x).size()))
#define all(x) begin(x), end(x)
#define REP(a, b, c, d) for (int a = (b); (d) > 0 ? a <= (c) : a >= (c); a += (d))
#define FOR(a, b, c) REP(a, b, c, 1)
#define ROF(a, b, c) REP(a, b, c, -1)
#define chmax(a, b) (a = a > (b) ? a : (b))
#define chmin(a, b) (a = a < (b) ? a : (b))
void Anna(int N, int K, vt<int> R, vt<int> C) {
FOR(i, 0, N-1)
FOR(j, 0, N-1) {
int v = 0;
if (i % 3 == 0 && j % 3 == 0)
v = 128;
else if (i % 3 == 0 && j % 3 == 1 || i % 3 == 1 && j % 3 == 2 || i % 3 == 2 && j % 3 == 0)
FOR(k, 0, K-1)
v |= (R[k] > i) << k;
else if (i % 3 == 0 && j % 3 == 2 || i % 3 == 1 && j % 3 == 0 || i % 3 == 2 && j % 3 == 1)
FOR(k, 0, K-1)
v |= (C[k] < j) << k;
SetFlag(i, j, v + 1);
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
#define vt vector
#define size(x) (int((x).size()))
#define all(x) begin(x), end(x)
#define REP(a, b, c, d) for (int a = (b); (d) > 0 ? a <= (c) : a >= (c); a += (d))
#define FOR(a, b, c) REP(a, b, c, 1)
#define ROF(a, b, c) REP(a, b, c, -1)
#define chmin(a, b) (a = a < (b) ? a : (b))
#define chmax(a, b) (a = a > (b) ? a : (b))
vt<int> Bruno(int K, vt<int> V) {
for (int &i : V)
i--;
int l0, l1, l2, d0, d1, d2;
if (V[0] == 128 || V[4] == 128 || V[8] == 128)
l0 = V[3], l1 = V[7], l2 = V[2], d0 = V[1], d1 = V[5], d2 = V[6];
else if (V[1] == 128 || V[5] == 128 || V[6] == 128)
l0 = V[0], l1 = V[4], l2 = V[8], d0 = V[2], d1 = V[3], d2 = V[7];
else if (V[2] == 128 || V[3] == 128 || V[7] == 128)
l0 = V[6], l1 = V[1], l2 = V[5], d0 = V[0], d1 = V[4], d2 = V[8];
vt<int> ret(K, 4);
FOR(i, 0, K-1) {
if (l1 & 1 << i)
ret[i] = 1;
else if (!(l2 & 1 << i))
ret[i] = 0;
}
FOR(i, 0, K-1) {
if (d1 & 1 << i)
ret[i] = 2;
else if (!(d0 & 1 << i))
ret[i] = 3;
}
return ret;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |