제출 #1011915

#제출 시각아이디문제언어결과실행 시간메모리
1011915Dedibeat3D Histogram (COCI20_histogram)C++17
20 / 110
2581 ms6076 KiB
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
    int n;
    cin >> n;
    pair<int, int> a[n+5];
    for(int i = 0; i<n; i++) {
           cin >> a[i].first;
           cin >> a[i].second;
    }
    int ans = 0;
    for(int i = 0; i<n; i++){
          int mn1 = 1e18, mn2 = 1e18;

          for(int j = i; j<n; j++){
               mn1 = min(a[j].first, mn1);
               mn2 = min(a[j].second, mn2);
             //  cout << i << " " << j << " "<< mn1 << " " << mn2 << endl;
               ans = max(mn1 * mn2 * (j - i + 1) ,ans );
          }
    }
    cout << ans;


}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...