Submission #69920

#TimeUsernameProblemLanguageResultExecution timeMemory
69920chhunTreasure (different grader from official contest) (CEOI13_treasure2)C++14
100 / 100
4 ms672 KiB
#include "treasure.h" int mat[105][105]; void findTreasure(int N) { for (int i = N; i >= 1; i--) { for (int j = N; j >= 1; j--) { if (i <= N / 2 && j <= N / 2) { mat[i][j] = mat[i][N] + mat[N][j] + countTreasure(i + 1, j + 1, N, N) - mat[N][N]; } else if (i <= N / 2 && j > N / 2) { mat[i][j] = mat[N][j] - countTreasure(i + 1, 1, N, j); } else if (i > N/2 && j <= N / 2) { mat[i][j] = mat[i][N] - countTreasure(1, j + 1, i, N); } else if (i > N / 2 && j > N / 2) { mat[i][j] = countTreasure(1, 1, i, j); } } } for (int i = 1; i <= N; i++) { for (int j = 1; j <= N; j++) { int a = mat[i][j] - mat[i - 1][j] - mat[i][j - 1] + mat[i - 1][j - 1]; if (a > 0) Report(i, j); } } }
#Verdict Execution timeMemoryGrader output
Fetching results...