# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
40824 | hsb154 | Treasure (different grader from official contest) (CEOI13_treasure2) | C++14 | 2 ms | 628 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 countTreasure(int r1, int c1, int r2, int c2);
void Report(int r, int c);
int map[101][101];
//#include<cstdio>
void findTreasure(int N) {
for (int i = N / 2 + 1; i <= N; i++) {
for (int j = N / 2 + 1; j <= N; j++) {
map[i][j] = countTreasure(1, 1, i, j);
}
}
for (int i = N/2+1; i <=N; i++) {
for (int j = 1; j <= N/2; j++) {
map[i][j] = map[i][N] - countTreasure(1, j + 1, i, N);
}
}
for (int i = 1; i <= N / 2; i++) {
for (int j = N / 2 + 1; j <= N; j++) {
map[i][j] = map[N][j] - countTreasure(i+1,1 , N, j);
}
}
for (int i = 1; i <= N / 2; i++) {
for (int j = 1; j <= N / 2; j++) {
map[i][j]=map[i][N]+map[N][j]-map[N][N]+ countTreasure(i + 1, j+1, N, N);
}
}
int check = 0;
for (int i = 1; i <= N; i++) {
for (int j = 1; j <= N; j++) {
int up=0;
int left=0;
int upleft=0;
if (i != 1)
up = map[i - 1][j];
if (j != 1)
left = map[i][j - 1];
if (i != 1 && j != 1)
upleft = map[i - 1][j - 1];
if (map[i][j] != up + left - upleft)
Report(i, j);
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |