# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
391327 | Mlxa | Navigation 2 (JOI21_navigation2) | C++17 | 1052 ms | 824 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;
bool bit[8];
void smth(int i, int j) {
int msk = 0;
for (int i = 0; i < 8; ++i) {
if (bit[i]) {
msk |= (1 << i);
}
}
SetFlag(i, j, msk + 1);
}
void Anna(int n, int k, vector<int> r, vector<int> c) {
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
bit[7] = (i + j) % 2;
for (int t = 0; t < 7; ++t) {
int x = r[t], y = c[t];
bool eq = (i / 2 + j / 2) % 2;
if (bit[7]) {
bit[t] = i < x || (i == x && eq);
} else {
bit[t] = j < y || (j == y && eq);
}
}
smth(i, j);
}
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
/*
bit[7] = (i + j) % 2;
for (int t = 0; t < 7; ++t) {
int x = r[t], y = c[t];
if (bit[7]) {
bit[t] = i <= x;
} else {
bit[t] = j <= y;
}
}
*/
bool bit(int m, int i) {
--m;
return (m >> i) & 1;
}
vector<int> Bruno(int k, vector<int> value) {
vector<int> answer;
if (bit(value[4], 7)) {
// for (int i = 0; i < 3; ++i) {
// for (int j = 0; j < 3; ++j) {
// cout << bit(value[3 * i + j], 0) << " ";
// }
// cout << endl;
// }
for (int i = 0; i < 7; ++i) {
if (!bit(value[0], i) || !bit(value[2], i)) {
answer.push_back(3);
} else if (bit(value[6], i) || bit(value[8], i)) {
answer.push_back(2);
} else if (bit(value[1], i) && bit(value[7], i)) {
answer.push_back(0);
} else if (!bit(value[7], i) && !bit(value[1], i)) {
answer.push_back(1);
} else {
answer.push_back(4);
}
}
} else {
for (int i = 0; i < 7; ++i) {
if (!bit(value[0], i) || !bit(value[6], i)) {
answer.push_back(1);
} else if (bit(value[8], i) || bit(value[2], i)) {
answer.push_back(0);
} else if (bit(value[3], i) && bit(value[5], i)) {
answer.push_back(2);
} else if (!bit(value[5], i) && !bit(value[3], i)) {
answer.push_back(3);
} else {
answer.push_back(4);
}
}
}
return answer;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |