Submission #1124735

#TimeUsernameProblemLanguageResultExecution timeMemory
1124735codexistentTreasure (different grader from official contest) (CEOI13_treasure2)C++20
0 / 100
0 ms328 KiB
#include "treasure.h" #define ll long long #define FOR(i, a, b) for(ll i = a; i <= b; i++) #define MAXN 105 ll pfx[MAXN][MAXN], m; void findTreasure (int N) { int cnt = countTreasure(1, 1, N, N); if(cnt > 0) Report (1, 1); m = N / 2; FOR(i, 0, N) FOR(j, 0, N) pfx[i][j] = 0; FOR(i, m + 1, N) FOR(j, m + 1, N) pfx[i][j] = countTreasure(1, 1, i, j); FOR(i, m + 1, N) FOR(j, 1, m) pfx[i][j] = pfx[i][N] - countTreasure(i, j + 1, i, N); FOR(i, 1, m) FOR(j, m + 1, N) pfx[i][j] = pfx[N][j] - countTreasure(i + 1, j, N, j); FOR(i, 1, N) FOR(j, 1, N) pfx[i][j] = pfx[N][j] + pfx[i][N] - pfx[N][N] - countTreasure(i + 1, j + 1, N, N); FOR(i, 1, N){ FOR(j, 1, N){ if(pfx[i][j] - pfx[i - 1][j] - pfx[i][j - 1] + pfx[i - 1][j - 1]){ Report (i, j); } } } }
#Verdict Execution timeMemoryGrader output
Fetching results...