This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int main(){
int n;
cin>>n;
vector<pair<int,int>>histo(n);
for (int i=0; i<n; i++) cin>>histo[i].first>>histo[i].second;
long long int ans=0;
for (int i=0; i<n; i++){
int x=histo[i].first, y=histo[i].second;
for (int j=i; j<n; j++){
if (histo[j].first<x) x=histo[j].first;
if (histo[j].second<y) y=histo[j].second;
ans=max(ans, (long long int)x*y*(j-i+1));
}
}cout<<ans<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |