Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <cstring>
- #include <stack>
- #include <bits/stdc++.h>
- #include <vector>
- #include <bitset>
- #define rep(a,b,c) for(a = b; a <= c; ++a)
- #define pob pop_back
- #define pof pop_front
- #define pub push_back
- #define f first
- #define s second
- #define ll long long int
- #define nmax 200001
- #define mod 998244353
- using namespace std;
- ifstream fin("joc13.in");
- ofstream fout("joc13.out");
- int a[101][101], maximao = -1, n;
- int main()
- {
- int i, j;
- fin >> n;
- rep(i,1,n)
- {
- fin >> a[1][i];
- rep(j,1,i - 1)
- {
- if(a[1][j] != 0)
- a[j + 1][i] = min(a[1][i], a[1][j]) * (i - j);
- maximao = max(maximao, a[j + 1][i]);
- }
- }
- fout << maximao;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement