Submission #1011914

# Submission time Handle Problem Language Result Execution time Memory
1011914 2024-07-01T10:59:16 Z Dedibeat 3D Histogram (COCI20_histogram) C++17
0 / 110
4 ms 348 KB
#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

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 time Memory Grader output
1 Incorrect 4 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -