# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
533321 | fhvirus | Navigation 2 (JOI21_navigation2) | C++17 | 2000 ms | 2444 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 <cmath>
#include <vector>
#include <iostream>
namespace {
const int kMark = 14;
std::vector<std::vector<int>> flag;
void init(const int& N) {
flag.assign(N, std::vector<int>(N, 0));
}
int get_val(const int& i, const int& j, const int& r, const int& c) {
if (j <= c - 2) return 10;
if (j >= c + 2) return 11;
if (i <= r - 2) return 12;
if (i >= r + 2) return 13;
int di = i - r, dj = j - c;
return (di + 1) * 3 + (dj + 1) + 1;
}
void solve(const int& N, const int& K, const std::vector<int>& R, const std::vector<int>& C) {
for (int i = 0; i < N; ++i)
for (int j = 0; j < N; ++j) {
int k = (i % 3) * 3 + (j % 3);
flag[i][j] = (k < 7 ? get_val(i, j, R[k], C[k]) : (k == 8 ? kMark : 1));
}
}
} // namespace
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |