Submission #75457

#TimeUsernameProblemLanguageResultExecution timeMemory
75457VasiljkoTreasure (different grader from official contest) (CEOI13_treasure2)C++14
0 / 100
3 ms672 KiB
#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]; bool found[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)found[i][j]=1; } } 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)found[i][j]=1; } } 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)found[i][j]=1; } } 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)found[i][j]=1; } } for(int i=1;i<=N;i++){ for(int j=1;j<=N;j++){ if(found[i][j])Report(i,j); } } }
#Verdict Execution timeMemoryGrader output
Fetching results...