Submission #851392

#TimeUsernameProblemLanguageResultExecution timeMemory
851392vjudge13D Histogram (COCI20_histogram)C++17
0 / 110
1 ms344 KiB
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize("Ofast,O3,unroll-loops") #define int long long #define vi vector<int> #define vvi vector<vi> #define pii pair<int, int> #define vpi vector<pii> #define vvpi vector<vpi> #define vb vector<bool> #define vvb vector<vb> #define endl "\n" #define sp << " " << #define F(i, s, n) for(int i = s; i < n; i++) #define pb push_back #define fi first #define se second int inf = LLONG_MAX >> 3; void solve() { int n; cin >> n; vpi a(n); F(i, 0, n) cin >> a[i].first >> a[i].second; //sort(a.begin(), a.end(), [](pii one, pii two) { // return min(one.fi, one.se) > min(two.fi, two.se); //}); int mx = 0; int mnx = inf, mny = inf; F(i, 0, n) { mnx = min(mnx, a[i].fi); mny = min(mny, a[i].se); mx = max(mx, mnx * mny * (i+1)); } cout << mx << endl; } void setIO() { ios::sync_with_stdio(0); cin.tie(0); #ifdef Local freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout); #endif } signed main() { setIO(); solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...