Submission #940690

# Submission time Handle Problem Language Result Execution time Memory
940690 2024-03-07T13:29:04 Z pakapu 3D Histogram (COCI20_histogram) C++17
0 / 110
1 ms 488 KB
#include <bits/stdc++.h>

using namespace std;

#define int long long

signed main()
{
	int n;
	cin >> n;

	vector<int> a(n);
	vector<int> b(n);

	for (int i = 0; i < n; i++) {
		cin >> a[i] >> b[i];
	}

	int curr_len = 1;
	int curr_min_a = a[0];
	int curr_min_b = b[0];
	int prev_ans = a[0] * b[0];
	int ans = a[0] * b[0];

	for (int i = 1; i < n; i++) {
		curr_min_a = min(curr_min_a, a[i]);
		curr_min_b = min(curr_min_b, b[i]);
		curr_len++;

		if (curr_min_a * curr_min_b * curr_len <= prev_ans) {
			curr_min_a = a[i];
			curr_min_b = b[i];
			curr_len = 1;
		}

		ans = max(ans, curr_min_a * curr_min_b * curr_len);
	}

	cout << ans << '\n';

	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 488 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 488 KB Output isn't correct
2 Halted 0 ms 0 KB -