Submission #1011073

# Submission time Handle Problem Language Result Execution time Memory
1011073 2024-06-29T18:27:32 Z Dan4Life Soccer Stadium (IOI23_soccer) C++17
0 / 100
0 ms 348 KB
#include "soccer.h"
#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define sz(a) (int)a.size()
#define all(a) begin(a),end(a)

const int mxN = (int)1e3+10;
int n;
set<int> col[mxN];

int biggest_stadium(int N, vector<vector<int>> F)
{
	n = N; int ans = 0;
	vector<vector<int>> xd;
	for(int i = 0; i < n; i++){
		xd.pb({});
		for(int j = 0; j < n; j++){
			xd[i].pb(0);
			if(!F[i][j]) continue;
			col[j].insert(i);
		}
		col[i].insert(-1),col[i].insert(n);
	}
	for(int _ = 0; _ < 4; _++){
		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				for(int k = i; k < n; k++){
					if(F[k][j]) break;
					for(int l = i; l <= k; l++){
						int U = i, D = k;
						int tot = D-U+1;
						for(int m = j-1; m>=0; m--){
							if(F[l][m]) break;
							auto itr2 = col[m].lower_bound(l);
							auto itr = itr2; itr--;
							U = max(U,*itr+1);
							D = min(D,*itr2-1);
							tot+=D-U+1;
						}
						U = i, D = k;
						for(int m = j+1; m < n; m++){
							if(F[l][m]) break;
							auto itr2 = col[m].lower_bound(l);
							auto itr = itr2; itr--;
							U = max(U,*itr+1);
							D = min(D,*itr2-1);
							tot+=D-U+1;
						}
						ans = max(ans, tot);
					}
				}
			}
		}
		for(int i = 0; i < n; i++)
			for(int j = 0; j < n; j++)
				xd[j][i] = F[i][j];
		for(int i = 0; i < n; i++)
			for(int j = 0; j <= n/2; j++)
				F[i][j] = xd[i][n-j];
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB ok
2 Incorrect 0 ms 348 KB wrong
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB ok
2 Incorrect 0 ms 348 KB wrong
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB wrong
2 Halted 0 ms 0 KB -