Submission #264856

#TimeUsernameProblemLanguageResultExecution timeMemory
264856sjimedTreasure (different grader from official contest) (CEOI13_treasure2)C++14
100 / 100
1 ms384 KiB
#include "treasure.h" int sum[111][111]; void findTreasure (int N) { int n = N; for(int i=n; i>=1; i--) { for(int j=n; j>=1; j--) { if(i > n/2 && j > n/2) sum[i][j] = countTreasure(1, 1, i, j); else if(i > n/2 && j <= n/2) sum[i][j] = sum[i][n] - countTreasure(1, j+1, i, n); else if(j > n/2 && i <= n/2) sum[i][j] = sum[n][j] - countTreasure(i+1, 1, n, j); else sum[i][j] = sum[i][n] + sum[n][j] - sum[n][n] + countTreasure(i+1, j+1, n, n); } } for(int i=1; i<=n; i++) for(int j=1; j<=n; j++) if(sum[i][j] - sum[i-1][j] - sum[i][j-1] + sum[i-1][j-1]) Report(i, j); }
#Verdict Execution timeMemoryGrader output
Fetching results...