Submission #1124751

#TimeUsernameProblemLanguageResultExecution timeMemory
1124751codexistentTreasure (different grader from official contest) (CEOI13_treasure2)C++20
0 / 100
1 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) { 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, 1, N) FOR(j, 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(1, 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, 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...