# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
69920 | chhun | 보물 찾기 (CEOI13_treasure2) | C++14 | 4 ms | 672 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 mat[105][105];
void findTreasure(int N) {
for (int i = N; i >= 1; i--) {
for (int j = N; j >= 1; j--) {
if (i <= N / 2 && j <= N / 2) {
mat[i][j] = mat[i][N] + mat[N][j] + countTreasure(i + 1, j + 1, N, N) - mat[N][N];
}
else if (i <= N / 2 && j > N / 2) {
mat[i][j] = mat[N][j] - countTreasure(i + 1, 1, N, j);
}
else if (i > N/2 && j <= N / 2) {
mat[i][j] = mat[i][N] - countTreasure(1, j + 1, i, N);
}
else if (i > N / 2 && j > N / 2) {
mat[i][j] = countTreasure(1, 1, i, j);
}
}
}
for (int i = 1; i <= N; i++) {
for (int j = 1; j <= N; j++) {
int a = mat[i][j] - mat[i - 1][j] - mat[i][j - 1] + mat[i - 1][j - 1];
if (a > 0)
Report(i, j);
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |