Submission #1066008

# Submission time Handle Problem Language Result Execution time Memory
1066008 2024-08-19T14:07:04 Z raspy Soccer Stadium (IOI23_soccer) C++17
0 / 100
1 ms 348 KB
#include "soccer.h"

#define vi vector<int>
#define ll long long

using namespace std;

int kum(vector<vi>& a, int i, int j, int ii, int jj)
{
	return a[ii][jj]-a[ii][j-1]-a[i-1][jj]+a[i-1][j-1];
}

int biggest_stadium(int n, vector<vector<int>> f)
{
	vector<vi> a(n+1, vi(n+1));
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= n; j++)
			a[i][j] = a[i-1][j]+a[i][j-1]-a[i-1][j-1]+f[i-1][j-1];
	int rez = 0;
	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			for (int ii = 0; ii < n; ii++)
				for (int jj = 0; jj < n; jj++)
					for (int iii = 0; iii < n; iii++)
						for (int jjj = 0; jjj < n; jjj++)
							for (int iiii = 0; iiii < n; iiii++)
								for (int jjjj = 0; jjjj < n; jjjj++)
								{
									int pl = (i+1)*(j+1)+(n-jj)*(ii+1)+(n-iii)*(jjj+1) + (n-iiii)*(n-jjjj);
									int vs = kum(a, 1, 1, i+1, j+1);
									vs += kum(a, 1, jj+1, ii+1, n);
									vs += kum(a, iii+1, 1, n, jj+1);
									vs += kum(a, iiii+1, jjjj+1, n, n);
									if (vs >= a[n][n])
										rez = max(rez, n*n-pl);
								}
	return rez;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB ok
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB wrong
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB ok
2 Incorrect 0 ms 348 KB wrong
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB ok
2 Incorrect 0 ms 348 KB wrong
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB ok
2 Incorrect 0 ms 348 KB wrong
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB ok
2 Incorrect 0 ms 348 KB wrong
3 Halted 0 ms 0 KB -