# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
254969 | super_j6 | Cop and Robber (BOI14_coprobber) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
#define endl '\n'
#define ll long long
#define pi pair<int, int>
#define f first
#define s second
const int mxn = 500;
int n, k;
int c;
pi f(int x){
return {x / k, x % k};
}
int ff(pi p){
return p.f * k + p.s;
}
int start(int N, bool g[mxn][mxn]){
n = N;
for(k = 1; k < n && g[k - 1][k]; k++);
for(int i = 0; i < n; i++){
if(count(g[i], g[i] + n, 1) > 4) return -1;
}
return c = ff({0, 0});
}
int nextMove(int r){
pi pc = f(c), pr = f(r);
pr.f -= pc.f, pr.s -= pc.s;
return -1;
if(abs(pr.f) > abs(pr.s)){
pc.f += 2 * (pr.f > 0) - 1;
}else if(abs(pr.s) > abs(pr.f)){
pc.s += 2 * (pr.s > 0) - 1;
}
return c = ff(pc);
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
return 0;
}