# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
433990 | rainboy | Mecho (IOI09_mecho) | C11 | 229 ms | 9024 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 <stdio.h>
#define N 800
int di[] = { -1, 1, 0, 0 };
int dj[] = { 0, 0, -1, 1 };
char cc[N][N + 1];
int dd_[N][N], dd[N][N], qu[N * N], n, s;
int solve(int im, int jm, int id, int jd, int t) {
int i, j, head, cnt;
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
dd[i][j] = n * n;
head = cnt = 0;
dd[im][jm] = 0, qu[head + cnt++] = im * n + jm;
while (cnt) {
int ij, h, d;
ij = qu[cnt--, head++], i = ij / n, j = ij % n, d = dd[i][j] + 1;
if (dd_[i][j] <= t + dd[i][j] / s)
continue;
if (i == id && j == jd)
return 1;
for (h = 0; h < 4; h++) {
int i_ = i + di[h], j_ = j + dj[h];
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |