제출 #998499

#제출 시각아이디문제언어결과실행 시간메모리
998499irmuun축구 경기장 (IOI23_soccer)C++17
0 / 100
1 ms348 KiB
#include<bits/stdc++.h> #include "soccer.h" using namespace std; #define ll long long #define pb push_back #define ff first #define ss second #define all(s) s.begin(),s.end() #define rall(s) s.rbegin(),s.rend() int n; vector<vector<int>>f; int solve(int x,int y){ int lx=x,rx=x,ly=y,ry=y; while(lx>0&&f[lx-1][y]==0){ lx--; } while(rx<n-1&&f[rx+1][y]==0){ rx++; } while(ly>0&&f[x][ly-1]==0){ ly--; } while(ry<n-1&&f[x][ry+1]==0){ ry++; } int left=ly,right=ry; int total=rx-lx+ry-ly+1; for(int i=x-1;i>=lx;i--){ int j=y; while(j>left&&f[i][j-1]==0){ j--; } total+=y-j; left=j; j=y; while(j>right&&f[i][j+1]==0){ j++; } total+=j-y; right=j; } left=ly,right=ry; for(int i=x+1;i<=rx;i++){ int j=y; while(j>left&&f[i][j-1]==0){ j--; } total+=y-j; left=j; j=y; while(j>right&&f[i][j+1]==0){ j++; } total+=j-y; right=j; } return total; } int biggest_stadium(int N,vector<vector<int>>F){ n=N; f=F; int ans=0; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(f[i][j]==0){ ans=max(ans,solve(i,j)); } } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...