Submission #53332

#TimeUsernameProblemLanguageResultExecution timeMemory
53332ics0503Treasure (different grader from official contest) (CEOI13_treasure2)C++17
100 / 100
3 ms688 KiB
#include "treasure.h" int S[121][121]; void findTreasure (int n) { int i, j, m = n/2; for (i = n; i >= 1; i--)for (j = n; j >= 1; j--) { if (m < i&&m < j)S[i][j] = countTreasure(1, 1, i, j); if (m < i&&j <= m)S[i][j] = S[i][n] - countTreasure(1, j + 1, i, n); if (i <= m&&m < j)S[i][j] = S[n][j] - countTreasure(i + 1, 1, n, j); if (i <= m&&j <= m) S[i][j] = countTreasure(i + 1, j + 1, n, n) - S[n][n] + S[n][j] + S[i][n]; } for (i = 1; i <= n; i++)for (j = 1; j <= n; j++)if (S[i][j] - S[i - 1][j] - S[i][j - 1] + S[i - 1][j - 1])Report(i, j); }
#Verdict Execution timeMemoryGrader output
Fetching results...