| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1339557 | hccoder | 축구 경기장 (IOI23_soccer) | C++20 | 4592 ms | 3204 KiB |
#include "bits/stdc++.h"
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
using namespace std;
using ll = long long;
int biggest_stadium(int n, vector<vector<int>> F){
vector<vector<int>> p(n, vector<int>(n+1));
for (int i = 0; i<n; i++){
for (int j = 1; j<=n; j++){
p[i][j] = p[i][j-1] + F[j-1][i];
}
}
auto get = [&] (int i, int l, int r) -> int {
return p[i][r+1]-p[i][l];
};
int res = 0;
for (int i = 0; i<n; i++){
for (int m = 0; m<n; m++){
if (F[m][i]) continue;
int L = m, R = m;
for (int z = m-1; z>=0; z--){
if (!F[z][i]) L--;
else break;
}
for (int z = m+1; z<n; z++){
if (!F[z][i]) R++;
else break;
}
int x = L, y = R;
int cur = R-L+1;
vector<pair<int, int>> vec;
for (int j = i+1; j<n; j++){
if (F[m][j]) break;
int l = m, r = m;
for (int z = m-1; z>=L; z--){
if (!F[z][j]) l--;
else break;
}
for (int z = m+1; z<=R; z++){
if (!F[z][j]) r++;
else break;
}
L = l;
R = r;
cur += (R-L+1);
vec.push_back({L,R});
}
L = x, R = y;
for (int j = i-1; j>=0; j--){
if (F[m][j]) break;
int l = m, r = m;
for (int z = m-1; z>=L; z--){
bool f = true;
for (auto [ll, rr]: vec){
if (ll<l-1 && rr<r) {
f = false;
break;
}
if (l-1<ll && r<rr){
f = false;
break;
}
}
if (!F[z][j] && f) l--;
else break;
}
for (int z = m+1; z<=R; z++){
bool f = true;
for (auto [ll, rr]: vec){
if (ll<l && rr<r+1) {
f = false;
break;
}
if (l<ll && r+1<rr){
f = false;
break;
}
}
if (!F[z][j] && f) r++;
else break;
}
L = l;
R = r;
cur += (R-L+1);
}
res = max(res, cur);
}
}
return res;
}
// int main(){
// int r = biggest_stadium(3, {{0, 0, 1}, {0, 0, 0}, {1, 0, 0}});
// cout<<r;
// }
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
