SHARE
TWEET

Untitled

a guest Jul 18th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5.  
  6.  
  7. int main()
  8. {
  9.   long long int n, i, j, v[5000], debit = 0, pmin;
  10.   cin >> n;
  11.   for(i = 1; i <= n; ++i)
  12.     cin >> v[i];
  13.   for(i = 1; i < n; ++i)
  14.     for(j = i + 1; j <= n; ++j)
  15.     {
  16.       pmin= min(v[i], v[j]);
  17.       debit = max(((j - i) * pmin), debit);
  18.       //cout << debit << ' ';
  19.     }
  20.     cout << debit;
  21.  
  22.  
  23.   return 0;
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top