Submission #94985

#TimeUsernameProblemLanguageResultExecution timeMemory
94985popovicirobertTreasure (different grader from official contest) (CEOI13_treasure2)C++14
48 / 100
2 ms376 KiB
#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 timeMemoryGrader output
Fetching results...