# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
465167 | zxcvbnm | Treasure (different grader from official contest) (CEOI13_treasure2) | C++14 | 3 ms | 332 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"
#include <bits/stdc++.h>
using namespace std;
int pref[105][105];
void findTreasure (int N) {
int n = N;
int mid = n/2;
for(int i = n; i >= 1; i--) {
for(int j = n; j >= 1; j--) {
if (i > mid && j > mid) {
pref[i][j] = countTreasure(1, 1, i, j);
} else if (i > mid) {
pref[i][j] = pref[i][n] - countTreasure(1, j+1, i, n);
} else if (j > mid) {
pref[i][j] = pref[n][j] - countTreasure(i+1, 1, n, j);
} else {
pref[i][j] = pref[n][j] + pref[i][n] + countTreasure(i+1, j+1, n, n) - pref[n][n];
}
}
}
for(int i = 1; i <= n; i++) {
for(int j = 1; j <= n; j++) {
if (pref[i][j] - pref[i-1][j] - pref[i][j-1] + pref[i-1][j-1]) {
Report(i, j);
}
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |