# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
53332 | ics0503 | Treasure (different grader from official contest) (CEOI13_treasure2) | C++17 | 3 ms | 688 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 "treasure.h"
int S[121][121];
void findTreasure (int n) {
int i, j, m = n/2;
for (i = n; i >= 1; i--)for (j = n; j >= 1; j--) {
if (m < i&&m < j)S[i][j] = countTreasure(1, 1, i, j);
if (m < i&&j <= m)S[i][j] = S[i][n] - countTreasure(1, j + 1, i, n);
if (i <= m&&m < j)S[i][j] = S[n][j] - countTreasure(i + 1, 1, n, j);
if (i <= m&&j <= m) S[i][j] = countTreasure(i + 1, j + 1, n, n) - S[n][n] + S[n][j] + S[i][n];
}
for (i = 1; i <= n; i++)for (j = 1; j <= n; j++)if (S[i][j] - S[i - 1][j] - S[i][j - 1] + S[i - 1][j - 1])Report(i, j);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |