Submission #53331

#TimeUsernameProblemLanguageResultExecution timeMemory
53331ics0503Treasure (different grader from official contest) (CEOI13_treasure2)C++17
90 / 100
2 ms556 KiB
#include "treasure.h" #include<stdio.h> //int countTreasure (int r1, int c1, int r2, int c2); int S[121][121]; void findTreasure (int n) { int i, j, m = (n + 1) / 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...