제출 #366453

#제출 시각아이디문제언어결과실행 시간메모리
366453VEGAnn3D Histogram (COCI20_histogram)C++14
20 / 110
16 ms1972 KiB
#include <bits/stdc++.h> #define i2 array<int,2> using namespace std; typedef long long ll; const int N = 100100; const int oo = 2e9; int n, a[N], b[N]; ll ans = 0; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); #ifdef _LOCAL freopen("in.txt","r",stdin); #endif // _LOCAL cin >> n; for (int i = 0; i < n; i++) cin >> a[i] >> b[i]; for (int i = 0; i < n; i++){ ll mn1 = a[i], mn2 = b[i]; for (int j = i; j < n; j++){ mn1 = min(mn1, (ll)a[j]); mn2 = min(mn2, (ll)b[j]); ans = max(ans, mn1 * mn2 * (ll(j) - ll(i) + 1ll)); } } cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...