# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
130108 | colorxxx | Treasure (different grader from official contest) (CEOI13_treasure2) | C++14 | 2 ms | 380 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 map[105][105];
void check(int r, int c, int N)
{
int m = N / 2;
if (r > m && c > m) map[r][c] = countTreasure(1, 1, r, c);
if (r > m && c <= m)map[r][c] = map[r][N] - countTreasure(1, c + 1, r, N);
if (r <= m && c > m) map[r][c] = map[N][c] - countTreasure(r + 1, 1, N, c);
if (r <= m && c <= m) map[r][c] = map[r][N] + map[N][c] + countTreasure(r + 1, c + 1, N, N) - map[N][N];
}
void findTreasure(int N) {
for (int i = N; i ; i--) {
for (int j = N; j ; j--) {
check(i, j, N);
}
}
for (int i = N; i ; i--) {
for (int j = N; j ; j--) {
if (map[i][j] - map[i - 1][j] - map[i][j - 1] + map[i - 1][j - 1])Report(i, j);
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |