Submission #210498

#TimeUsernameProblemLanguageResultExecution timeMemory
210498alexandra_udristoiuTreasure (different grader from official contest) (CEOI13_treasure2)C++14
100 / 100
6 ms552 KiB
#include<iostream> #include "treasure.h" using namespace std; static int a[105][105]; void findTreasure (int n) { int i, j, val; for(i = n / 2 + 1; i <= n; i++){ for(j = n / 2 + 1; j <= n; j++){ a[i][j] = countTreasure(1, 1, i, j); } for(j = 1; j <= n / 2; j++){ a[i][j] = a[i][n] - countTreasure(1, j + 1, i, n); } } for(i = n / 2; i >= 1; i--){ for(j = n / 2 + 1; j <= n; j++){ a[i][j] = a[n][j] - countTreasure(i + 1, 1, n, j); } for(j = n / 2; j >= 1; j--){ a[i][j] = a[i][n] + a[n][j] + countTreasure(i + 1, j + 1, n, n) - a[n][n]; } } for(i = 1; i <= n; i++){ for(j = 1; j <= n; j++){ val = a[i][j] - a[i - 1][j] - a[i][j - 1] + a[i - 1][j - 1]; if(val == 1){ Report(i, j); } } } }
#Verdict Execution timeMemoryGrader output
Fetching results...