Submission #778825

#TimeUsernameProblemLanguageResultExecution timeMemory
778825antonTreasure (different grader from official contest) (CEOI13_treasure2)C++17
44 / 100
1 ms468 KiB
#include<bits/stdc++.h> #include "treasure.h" using namespace std; #define int long long void findTreasure(signed n){ vector<vector<int>> s(n, vector<int> (n, 0)); for(int x = 0; x<n; x++){ for(int y= 0; y<n; y++){ s[x][y] = countTreasure(1, 1, x+1, y+1); } } vector<vector<int>> v(n, vector<int> (n, 0)); v[0][0] = s[0][0]; for(int i = 1; i<n; i++){ v[0][i] = s[0][i] - s[0][i-1]; } for(int i = 1; i<n; i++){ v[i][0] = s[i][0] - s[i-1][0]; } for(int x= 1; x<n; x++){ for(int y= 1; y<n; y++){ v[x][y] = s[x][y] + s[x-1][y-1] - s[x-1][y] - s[x][y-1]; } } for(int i = 0; i<n; i++){ for(int j= 0; j<n; j++){ if(v[i][j] ==1){ Report(i+1, j+1); } } } }
#Verdict Execution timeMemoryGrader output
Fetching results...