# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
778825 | anton | Treasure (different grader from official contest) (CEOI13_treasure2) | C++17 | 1 ms | 468 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |