Submission #1021947

# Submission time Handle Problem Language Result Execution time Memory
1021947 2024-07-13T08:05:34 Z j_vdd16 Soccer Stadium (IOI23_soccer) C++17
0 / 100
0 ms 348 KB
#include <algorithm>
#include <bitset>
#include <cstdint>
#include <cstring>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

//#define int long long
#define loop(X, N) for(int X = 0; X < (N); X++)
#define all(V) V.begin(), V.end()
#define rall(V) V.rbegin(), V.rend()

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<vector<ii>> vvii;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;


int biggest_stadium(int n, vvi f) {
	vvi high(n, vi(n)), low(n, vi(n));
	loop(x, n) {
		high[x][0] = 1 - f[x][0];
		for (int y = 1; y < n; y++) {
			if (f[x][y])
				high[x][y] = 0;
			else
				high[x][y] = high[x][y - 1] + 1;

		}

		low[x][n - 1] = 1 - f[x][n - 1];
		for (int y = n - 2; y >= 0; y--) {
			if (f[x][y])
				low[x][y] = 0;
			else
				low[x][y] = low[x][y + 1] + 1;
		}
		/*loop(y, n)
			cout << low[x][y] << ' ';

		cout << endl;*/
	}
	//cout << endl;

	int result = 0;
	loop(x, n) {
		loop(y, n) {
			int count = 0;
			int h = INT_MAX, l = INT_MAX;
			for (int x2 = x; x2 < n; x2++) {
				h = min(high[x2][y], h);
				count += h;

				l = min(low[x2][y], l);
				count += max(0, l - 1);
			}
			h = INT_MAX;
			for (int x2 = x - 1; x2 >= 0; x2--) {
				h = min(high[x2][y], h);
				count += h;

				l = min(low[x2][y], l);
				count += max(0, l - 1);
			}

			result = max(result, count);
			cout << count << ' ';
		}
		cout << endl;
	}

	return result;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Possible tampering with the output
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Possible tampering with the output
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Possible tampering with the output
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Possible tampering with the output
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Possible tampering with the output
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Possible tampering with the output
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Possible tampering with the output
2 Halted 0 ms 0 KB -