Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.007 s | 17 KBi |
#2 |
Incorrecto
|
0.007 s | 23 KBi |
#3 |
Correcto
|
0.005 s | 23 KBi |
#4 |
Correcto
|
0.006 s | 1 KBi |
#5 |
Incorrecto
|
0.005 s | 1 KBi |
#6 |
Incorrecto
|
0.208 s | 6 KBi |
#7 |
Correcto
|
0.175 s | 10 KBi |
#8 |
Correcto
|
0.362 s | 5 KBi |
#9 |
Incorrecto
|
0.182 s | 6 KBi |
#10 |
Incorrecto
|
0.262 s | 7 KBi |
#include <iostream> using namespace std; int main(){ long long c, n; cin >> c; for(int i=0; i<c;i++){ cin >> n; int input[n]; int output[n]; for(int j=0; j<n; j++){ cin >> input[j]; } int max=0; for(int j=n-1; j>=0; j--){ if(input[j]>=max){ output[j] = -1; max = input[j]; }else{ output[j] = max; } } cout << "Case #" << i+1 << ":"; for(int j=0; j<n; j++){ cout << " " << output[j]; } cout << "\n"; } return 0; }