Submission #86155

#TimeUsernameProblemLanguageResultExecution timeMemory
86155facelessTreasure (different grader from official contest) (CEOI13_treasure2)C++14
4 / 100
2 ms560 KiB
#include "treasure.h" bool c[120][120]; void find (int r1, int c1, int r2, int c2) { if (r1 == r2 or c1 == c2) return; int cnt = countTreasure (r1, c1, r2 - 1, c2 - 1); if (cnt == 0) return; if (r1 + 1 == r2 and c1 + 1 == c2) { c[r1][c1] = 1; return; } int mid1 = (r1 + r2) >> 1; int mid2 = (c1 + c2) >> 1; find (r1, c1, mid1, mid2); find (r1, mid2, mid1, c2); find (mid1, c1, r2, mid2); find (mid1, mid2, r2, c2); } void findTreasure (int N) { find (1, 1, N + 1, N + 1); for (int i = 1; i <= N; i++) for (int j = 1; j <= N; j++) if (c[i][j]) Report (i, j); }
#Verdict Execution timeMemoryGrader output
Fetching results...