# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
383936 | wp1270 | Treasure (different grader from official contest) (CEOI13_treasure2) | C++11 | 2 ms | 364 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 t[102][102];
void findTreasure(int N) {
int center = N / 2;
for (int i = center + 1; i <= N; i++) {
for (int j = center + 1; j <= N; j++) {
t[i][j] = countTreasure(1, 1, i, j);
}
}
for (int i = center + 1; i <= N; i++) {
for (int j = 1; j <= center; j++) {
t[i][j] = t[i][N] - countTreasure(1, j + 1, i, N);
}
}
for (int i = 1; i <= center; i++) {
for (int j = center + 1; j <= N; j++) {
t[i][j] = t[N][j] - countTreasure(i + 1, 1, N, j);
}
}
for (int i = 1; i <= center; i++) {
for (int j = 1; j <= center; j++) {
t[i][j] = t[N][j] + t[i][N] + countTreasure(i + 1, j + 1, N, N) - t[N][N];
}
}
for (int i = 1; i <= N; i++) {
for (int j = 1; j <= N; j++) {
if (t[i][j] - t[i - 1][j] - t[i][j - 1] + t[i - 1][j - 1]) {
Report(i, j);
}
}
}
}
/*
10
1011010101
1100010001
0100100101
0000101100
1111010100
0010100000
1101010001
0001010100
0101000100
1101010101
*/
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |