Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.005 s | 2 KBi |
#2 |
Correcto
|
0.004 s | 0 KBi |
#3 |
Correcto
|
0.002 s | 0 KBi |
#4 |
Correcto
|
0.004 s | 9 KBi |
#5 |
Correcto
|
0.004 s | 2 KBi |
#6 |
Correcto
|
0.004 s | 10 KBi |
#7 |
Correcto
|
0.005 s | 2 KBi |
#8 |
Correcto
|
0.005 s | 2 KBi |
#9 |
Correcto
|
0.004 s | 10 KBi |
#10 |
Correcto
|
0.002 s | 0 KBi |
#11 |
Correcto
|
0.005 s | 0 KBi |
#12 |
Correcto
|
0.002 s | 0 KBi |
#13 |
Correcto
|
0.005 s | 2 KBi |
#14 |
Correcto
|
0.036 s | 35 KBi |
#15 |
Correcto
|
0.003 s | 2 KBi |
#16 |
Correcto
|
0.03 s | 2 KBi |
#17 |
Correcto
|
0.026 s | 1 KBi |
#18 |
Correcto
|
0.004 s | 6 KBi |
#19 |
Correcto
|
0.005 s | 2 KBi |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); // your code goes here int N, t=0, ma=0; int i, j; int c; cin >> N; int arr[N]; for(i=0; i<N; i++){ cin >> arr[i]; t = arr[i] > t ? arr[i] : t; } for(i=1; i<=t; i++){ c = 0; for(j=0; j<N; j++){ if(arr[j] >= i){ c++; }else{ ma = i * c > ma ? i * c : ma; c = 0; } } ma = i * c > ma ? i * c : ma; } cout << ma << "\n"; return 0; }