Submission #163036

#TimeUsernameProblemLanguageResultExecution timeMemory
163036rolypolyvg295Treasure (different grader from official contest) (CEOI13_treasure2)C++14
44 / 100
3 ms504 KiB
#include "treasure.h" #include <vector> using namespace std; int calculate(int y, int x, vector<vector<int>>&count){ return count[y][x] - count[y+1][x] - count[y][x+1] + count[y+1][x+1]; } void findTreasure (int N) { vector<vector<int>> count(N+2, vector<int>(N+2, 0)); for (int i = 1; i <= N; i++) for (int j = 1; j <= N; j++){ count[i][j] = countTreasure(i,j, N, N); } for (int i = 1; i <= N; i++){ for (int j = 1; j <= N; j++) if (calculate(i, j , count) > 0) Report(i, j); } }
#Verdict Execution timeMemoryGrader output
Fetching results...