SHARE
TWEET

Untitled

a guest Jul 18th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <fstream>
  2. #include <cstring>
  3. #include <stack>
  4. #include <bits/stdc++.h>
  5. #include <vector>
  6. #include <bitset>
  7. #define rep(a,b,c) for(a = b; a <= c; ++a)
  8. #define pob pop_back
  9. #define pof pop_front
  10. #define pub push_back
  11. #define f first
  12. #define s second
  13. #define ll long long int
  14. #define nmax 200001
  15. #define mod 998244353
  16. using namespace std;
  17. ifstream fin("joc13.in");
  18. ofstream fout("joc13.out");
  19. int a[101][101], maximao = -1, n;
  20.  
  21. int main()
  22. {  
  23.   int i, j;
  24.   fin >> n;
  25.   rep(i,1,n)
  26.     {
  27.       fin >> a[1][i];
  28.       rep(j,1,i - 1)
  29.        {
  30.         if(a[1][j] != 0)
  31.           a[j + 1][i] = min(a[1][i], a[1][j]) * (i - j);
  32.         maximao = max(maximao, a[j + 1][i]);
  33.         }
  34.  
  35.     }
  36.   fout << maximao;
  37.   return 0;
  38. }
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