Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.005 s | 0 KBi |
#2 |
Correcto
|
0.001 s | 0 KBi |
#3 |
Correcto
|
0.002 s | 0 KBi |
#4 |
Correcto
|
0.003 s | 7 KBi |
#5 |
Correcto
|
0.002 s | 0 KBi |
#6 |
Correcto
|
0.004 s | 0 KBi |
#7 |
Correcto
|
0.002 s | 0 KBi |
#8 |
Correcto
|
0.001 s | 0 KBi |
#9 |
Correcto
|
0.002 s | 0 KBi |
#10 |
Correcto
|
0.002 s | 0 KBi |
#11 |
Correcto
|
0.002 s | 0 KBi |
#12 |
Correcto
|
0.002 s | 0 KBi |
#13 |
Correcto
|
0.004 s | 0 KBi |
#14 |
Correcto
|
0.001 s | 0 KBi |
#15 |
Correcto
|
0.002 s | 0 KBi |
#16 |
Correcto
|
0.003 s | 0 KBi |
#17 |
Correcto
|
0.005 s | 0 KBi |
#18 |
Correcto
|
0.001 s | 0 KBi |
#19 |
Correcto
|
0.006 s | 8 KBi |
// // Created by .slash on 3/20/2022. // #include <bits/stdc++.h> #define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL); #define ff first #define ss second #define pb push_back #define mp make_pair #define float_equals(a, b) (abs((a)-(b)) < 1e-9) #define float_equals(a, b) (abs((a)-(b)) < 1e-9) #define minus_infinite_int (1 << (31)) #define infinite_int (-(minus_infinite_int+1)) using namespace std; typedef long long ll; typedef vector<int> vi; typedef long long ll; typedef vector<int> vi; void tests(){ int max_area = 0, n ; cin>>n; vector<int> buildings = vector<int> (n); for (int i = 0; i < n; i++){ cin>>buildings[i]; } for (int i = 0; i < n; i++){ for(int j = i; j < n; j++){ int min_h = infinite_int; for (int k = i; k <= j; k++){ if (buildings [k] < min_h) min_h = buildings[k]; } if (min_h * ((j - i) + 1) > max_area) max_area = min_h * ((j - i) + 1); } } cout<<max_area; } int main(){tests();}