Submission #1011914

#TimeUsernameProblemLanguageResultExecution timeMemory
1011914Dedibeat3D Histogram (COCI20_histogram)C++17
0 / 110
4 ms348 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long int 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; }

Compilation message (stderr)

histogram.cpp: In function 'int main()':
histogram.cpp:14:21: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
   14 |           int mn1 = 1e18, mn2 = 1e18;
      |                     ^~~~
histogram.cpp:14:33: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
   14 |           int mn1 = 1e18, mn2 = 1e18;
      |                                 ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...