답안 #875330

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
875330 2023-11-19T07:03:30 Z TAhmed33 3D Histogram (COCI20_histogram) C++
20 / 110
2500 ms 6064 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main () {
	int n;
	cin >> n;
	pair <int, int> arr[n + 1];
	for (int i = 1; i <= n; i++) cin >> arr[i].first >> arr[i].second;
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		int mn1 = 1e9, mn2 = 1e9;
		for (int j = i; j <= n; j++) {
			mn1 = min(mn1, arr[j].first);
			mn2 = min(mn2, arr[j].second);
			ans = max(ans, mn1 * mn2 * (j - i + 1));
		}
	}
	cout << ans << '\n';
}
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 348 KB Output is correct
2 Correct 5 ms 348 KB Output is correct
3 Correct 4 ms 348 KB Output is correct
4 Correct 4 ms 348 KB Output is correct
5 Correct 4 ms 344 KB Output is correct
6 Correct 5 ms 448 KB Output is correct
7 Correct 4 ms 348 KB Output is correct
8 Correct 4 ms 348 KB Output is correct
9 Correct 4 ms 348 KB Output is correct
10 Correct 4 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 5 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 348 KB Output is correct
2 Correct 5 ms 348 KB Output is correct
3 Correct 4 ms 348 KB Output is correct
4 Correct 4 ms 348 KB Output is correct
5 Correct 4 ms 344 KB Output is correct
6 Correct 5 ms 448 KB Output is correct
7 Correct 4 ms 348 KB Output is correct
8 Correct 4 ms 348 KB Output is correct
9 Correct 4 ms 348 KB Output is correct
10 Correct 4 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 5 ms 348 KB Output is correct
13 Execution timed out 2556 ms 6064 KB Time limit exceeded
14 Halted 0 ms 0 KB -