Submission #741704

# Submission time Handle Problem Language Result Execution time Memory
741704 2023-05-14T15:43:33 Z a_aguilo 3D Histogram (COCI20_histogram) C++14
20 / 110
2500 ms 6088 KB
#include<bits/stdc++.h>

using namespace std;

int main(){
	int n;
	cin >> n;
	vector<long long int> top(n);
	vector<long long int> front(n);
	long long ans = 0;
	for(int i = 0; i < n; ++i) cin >> top[i] >> front[i];
	for(int i = 0; i < n; ++i){
		long long minTop = top[i];
		long long minFront = front[i];
		for(int j = i; j < n; ++j){
			minTop = min(minTop, top[j]);
			minFront = min(minFront, front[j]);
			long long ancho = j - i + 1;
			ans = max(ans, ancho*minTop*minFront);
		}
	}
	cout << ans << endl;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 340 KB Output is correct
2 Correct 4 ms 340 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Correct 5 ms 308 KB Output is correct
5 Correct 4 ms 340 KB Output is correct
6 Correct 5 ms 312 KB Output is correct
7 Correct 4 ms 312 KB Output is correct
8 Correct 4 ms 336 KB Output is correct
9 Correct 4 ms 340 KB Output is correct
10 Correct 5 ms 340 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 5 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 340 KB Output is correct
2 Correct 4 ms 340 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Correct 5 ms 308 KB Output is correct
5 Correct 4 ms 340 KB Output is correct
6 Correct 5 ms 312 KB Output is correct
7 Correct 4 ms 312 KB Output is correct
8 Correct 4 ms 336 KB Output is correct
9 Correct 4 ms 340 KB Output is correct
10 Correct 5 ms 340 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 5 ms 340 KB Output is correct
13 Execution timed out 2559 ms 6088 KB Time limit exceeded
14 Halted 0 ms 0 KB -