# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
107619 | patrikpavic2 | Cop and Robber (BOI14_coprobber) | C++17 | 43 ms | 1936 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "coprobber.h"
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
int mv = 0, pos, n, m;
bool a[MAX_N][MAX_N];
int start(int N, bool A[MAX_N][MAX_N]){
for(int i = 0;i < MAX_N;i++){
for(int j = 0;j < MAX_N;j++){
a[i][j] = A[i][j];
}
}
m = 0;
while(A[m][m + 1]) m++;m++;
n = N / m;
if(n <= 3 && m <= 3){
if(n == 3 && m == 3)
return pos = 4;
return pos = 1;
}
else if(n <= 3 || m <= 3){
if(n <= 3) return pos = m / 2 + (n == 3) * m;
return pos = N / 2;
}
return -1;
}
int nextMove(int R){
if(a[R][pos]) return R;
if(n <= 3 && m <= 3) return pos;
int Rx = R / m, Ry = R % m;
int Px = pos / m, Py = pos % m;
if(n <= 3){
if((Px + Py) % 2 == (Rx + Ry) % 2) return pos;
if(Py < Ry) return pos = pos + 1;
return pos = pos - 1;
}
if(m <= 3){
if((Px + Py) % 2 == (Rx + Ry) % 2) return pos;
if(Px < Rx) return pos = pos + m;
return pos = pos - m;
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |