#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;
const ll MAX=1e18;
int main(){
int n;
cin>>n;
ll he=MAX,wi=MAX;
vector<ii> x;
for(int i=0;i<n;i++){
ll a,b;
cin>>a>>b;
x.push_back(ii(a,b));
}
ll ma=-1;
for(int i=0;i<n;i++){
he=wi=MAX;
int nb=0;
for(int j=i;j<n;j++){
he=min(he,x[j].first);
wi=min(wi,x[j].second);
nb++;
ma=max(ma,he*wi*nb);
}
}
cout<<ma<<endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
336 KB |
Output is correct |
2 |
Correct |
5 ms |
372 KB |
Output is correct |
3 |
Correct |
6 ms |
332 KB |
Output is correct |
4 |
Correct |
6 ms |
332 KB |
Output is correct |
5 |
Correct |
4 ms |
332 KB |
Output is correct |
6 |
Correct |
6 ms |
304 KB |
Output is correct |
7 |
Correct |
5 ms |
364 KB |
Output is correct |
8 |
Correct |
5 ms |
296 KB |
Output is correct |
9 |
Correct |
7 ms |
332 KB |
Output is correct |
10 |
Correct |
6 ms |
388 KB |
Output is correct |
11 |
Correct |
1 ms |
204 KB |
Output is correct |
12 |
Correct |
6 ms |
352 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
336 KB |
Output is correct |
2 |
Correct |
5 ms |
372 KB |
Output is correct |
3 |
Correct |
6 ms |
332 KB |
Output is correct |
4 |
Correct |
6 ms |
332 KB |
Output is correct |
5 |
Correct |
4 ms |
332 KB |
Output is correct |
6 |
Correct |
6 ms |
304 KB |
Output is correct |
7 |
Correct |
5 ms |
364 KB |
Output is correct |
8 |
Correct |
5 ms |
296 KB |
Output is correct |
9 |
Correct |
7 ms |
332 KB |
Output is correct |
10 |
Correct |
6 ms |
388 KB |
Output is correct |
11 |
Correct |
1 ms |
204 KB |
Output is correct |
12 |
Correct |
6 ms |
352 KB |
Output is correct |
13 |
Execution timed out |
2570 ms |
4920 KB |
Time limit exceeded |
14 |
Halted |
0 ms |
0 KB |
- |