# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
75455 | Vasiljko | Treasure (different grader from official contest) (CEOI13_treasure2) | C++14 | 2 ms | 716 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 "treasure.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9+7;
const int N = 105;
int a[N][N];
void findTreasure(int N){
int m=N/2;
for(int i=1;i<=m;i++){
for(int j=1;j<=m;j++){
a[i][j]=countTreasure(1,1,i,j)-a[i-1][j]-a[i][j-1]+a[i-1][j-1];
if(a[i][j]==1)Report(i,j);
}
}
memset(a,0,sizeof(a));
for(int i=1;i<=m;i++){
for(int j=N;j>=m+1;j--){
a[i][j]=countTreasure(1,j,i,N)-a[i][j+1]-a[i-1][j]+a[i-1][j+1];
if(a[i][j]==1)Report(i,j);
}
}
memset(a,0,sizeof(a));
for(int i=N;i>=m+1;i--){
for(int j=1;j<=m;j++){
a[i][j]=countTreasure(i,1,N,j)-a[i][j-1]-a[i+1][j]+a[i+1][j-1];
if(a[i][j]==1)Report(i,j);
}
}
memset(a,0,sizeof(a));
for(int i=N;i>=m+1;i--){
for(int j=N;j>=m+1;j--){
a[i][j]=countTreasure(i,j,N,N)-a[i+1][j]-a[i][j+1]+a[i+1][j+1];
if(a[i][j]==1)Report(i,j);
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |