# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
533327 | fhvirus | Navigation 2 (JOI21_navigation2) | C++17 | 848 ms | 1008 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Anna.h"
#include <cmath>
#include <vector>
namespace {
const int kMark = 13;
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 9;
if (j >= c + 2) return 10;
if (i <= r - 2) return 11;
if (i >= r + 2) return 12;
int di = i - r, dj = j - c;
int val = (di + 1) * 3 + (dj + 1) + 1;
return (val == 9 ? -1 : val);
}
bool solve(const int& N, const int& K, const std::vector<int>& R, const std::vector<int>& C, const int& offset) {
for (int i = 0; i < N; ++i)
for (int j = 0; j < N; ++j) {
int k = ((i + offset / 3) % 3) * 3 + ((j + offset % 3) % 3);
flag[i][j] = (k < 7 ? get_val(i, j, R[k], C[k]) : (k == 8 ? kMark : 0));
if (flag[i][j] == -1) return false;
}
return true;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |