# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1075886 | raphaelp | Cop and Robber (BOI14_coprobber) | C++14 | 0 ms | 0 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 <bits/stdc++.h>
#include "coprobber.h"
using namespace std;
vector<vector<int>> AR;
int pos = 0, sz = 1;
int start(int N, bool A[500][500])
{
while (A[sz - 1][sz])
sz++;
return 0;
}
int nextMove(int R)
{
if (R / N == pos / N && R - N == 1)
return R;
if (R % N == pos % N &&R = pos + N)
return R;
if (R % N < pos % N)
{
pos--;
return pos;
}
if (R % N - 1 > pos % N)
{
pos++;
return pos;
}
if (R % N == pos % N + 1 && R / N == pos / N + 1)
return pos;
pos += N;
return pos;
}
/*int main()
{
int N = 5;
bool A[5][5] = {{0, 1, 0, 0, 0}, {1, 0, 1, 0, 0}, {0, 1, 0, 1, 0}, {0, 0, 1, 0, 1}, {0, 0, 0, 1, 0}};
start(N, A);
nextMove(4);
}*/