Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.001 s | 0 KBi |
#2 |
Correcto
|
0.001 s | 0 KBi |
#3 |
Correcto
|
0.001 s | 0 KBi |
#4 |
Correcto
|
0.001 s | 0 KBi |
#5 |
Correcto
|
0.002 s | 0 KBi |
#6 |
Correcto
|
0.001 s | 0 KBi |
#7 |
Correcto
|
0.002 s | 0 KBi |
#8 |
Correcto
|
0.002 s | 0 KBi |
#9 |
Correcto
|
0.001 s | 0 KBi |
#10 |
Correcto
|
0.002 s | 0 KBi |
#11 |
Correcto
|
0.022 s | 1 KBi |
#12 |
Correcto
|
0.023 s | 1 KBi |
#13 |
Correcto
|
0.027 s | 1 KBi |
#include <bits/stdc++.h> using namespace std; int main(){ int n, l, r, c; cin >> n; int arr[n]; for (int i = 0; i < n; i++) cin >> arr[i]; cin >> c; for (int i = 0; i < c; i++){ cin >> l >> r; int building, maxh; building = maxh = 0; for (int j = l; j < r + 1; j++){ if (arr[j] > maxh){ maxh = arr[j]; building = j; } } cout << building << endl; } return 0; }