Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.002 s | 0 KBi |
#2 |
Correcto
|
0.004 s | 31 KBi |
#3 |
Correcto
|
0.007 s | 10 KBi |
#4 |
Correcto
|
0.002 s | 0 KBi |
#5 |
Correcto
|
0.006 s | 1 KBi |
#6 |
Correcto
|
0.002 s | 0 KBi |
#7 |
Correcto
|
0.002 s | 0 KBi |
#8 |
Correcto
|
0.002 s | 0 KBi |
#9 |
Correcto
|
0.003 s | 0 KBi |
#10 |
Correcto
|
0.003 s | 0 KBi |
#11 |
Correcto
|
0.028 s | 1 KBi |
#12 |
Correcto
|
0.064 s | 1 KBi |
#13 |
Correcto
|
0.063 s | 5 KBi |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int arr[n]; for(int i = 0; i < n; i++) { cin>>arr[i]; } int c; cin>>c; int res[c]; for(int i = 0; i < c; i++) { int l, r; cin>>l>>r; int max = 0; for(int j = l; j <= r; j++) { if(arr[j] > max) { max = arr[j]; res[i] = j; } } } for(int i = 0; i < c; i++) { cout<<res[i]<<endl; } return 0; }