# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
94985 | popovicirobert | Treasure (different grader from official contest) (CEOI13_treasure2) | C++14 | 2 ms | 376 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"
const int MAXN = 100;
bool mat[MAXN + 1][MAXN + 1];
int cnt_c[MAXN + 1], cnt_l[MAXN + 1];
void findTreasure (int n) {
int i, j;
int sum_l = 0;
for(i = 1; i <= n; i++) {
sum_l = countTreasure(1, 1, i, n);
cnt_l[i] = sum_l;
int tot = 0;
int cnt = 0;
for(j = n; j > (n + 1) / 2; j--) {
int cur = countTreasure(1, 1, i, j - 1);
cnt += cnt_c[j];
if(sum_l - cur - cnt > 0) {
mat[i][j] = 1;
cnt++;
tot++;
}
}
cnt = 0;
for(j = 1; j < (n + 1) / 2; j++) {
int cur = countTreasure(1, j + 1, i, n);
cnt += cnt_c[j];
if(sum_l - cur - cnt > 0) {
mat[i][j] = 1;
cnt++;
tot++;
}
}
mat[i][(n + 1) / 2] = cnt_l[i] - cnt_l[i - 1] - tot;
for(j = 1; j <= n; j++) {
cnt_c[j] += mat[i][j];
}
}
for(i = 1; i <= n; i++) {
for(j = 1; j <= n; j++) {
if(mat[i][j]) {
Report(i, j);
}
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |