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 "coprobber.h"
#include <bits/stdc++.h>
using namespace std;
int L, C;
int pos = 0;
int start(int N, bool A[MAX_N][MAX_N])
{
for (int i = 1; i < N; i ++)
{
if (A[0][i]) C = i;
}
L = N/C;
return 0;
}
int nextMove(int R)
{
int lR, cR, lP, cP;
lR = R/C; cR = R%C;
lP = pos/C; cP = pos%C;
if (lR >= lP+2)
{
pos += C;
return pos;
}
else if (lR <= lP-2)
{
pos -=C;
return pos;
}
else if (cR >= cP+2)
{
pos += 1;
return pos;
}
else if (cR <= cP-2)
{
pos -= 1;
return pos;
}
else if (abs(lR-lP)+abs(cR-cP)==1)
{
pos = R;
return pos;
}
return pos;
}
# | 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... |