Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.006 s | 2 KBi |
#2 |
Incorrecto
|
0.005 s | 11 KBi |
#3 |
Incorrecto
|
0.006 s | 2 KBi |
#4 |
Incorrecto
|
0.005 s | 10 KBi |
#5 |
Incorrecto
|
0.006 s | 2 KBi |
#6 |
Error en tiempo de ejecución (NZEC)
Exited with error status 139 run: line 1: 3 Segmentation fault (core dumped) ./a.out |
0.014 s | 1 KBi |
#7 |
Error en tiempo de ejecución (NZEC)
Exited with error status 139 run: line 1: 3 Segmentation fault (core dumped) ./a.out |
0.01 s | 1 KBi |
#8 |
Error en tiempo de ejecución (NZEC)
Exited with error status 139 run: line 1: 3 Segmentation fault (core dumped) ./a.out |
0.021 s | 1 KBi |
#9 |
Error en tiempo de ejecución (NZEC)
Exited with error status 139 run: line 1: 3 Segmentation fault (core dumped) ./a.out |
0.009 s | 1 KBi |
#10 |
Error en tiempo de ejecución (NZEC)
Exited with error status 139 run: line 1: 3 Segmentation fault (core dumped) ./a.out |
0.016 s | 1 KBi |
#include <iostream> #include <vector> using namespace std; int main() { int cases, n; vector<int> a(n); vector<int> answer(n); cin >> cases; for (int c; c < cases; c++) { cin >> n; for (int i = 0; i < n; ++i) { cin >> a[i]; } for (int i = n - 1; i >= 0; i--) { int max_a = -1; for (int j = i; j < n; j++) { if (a[j] > a[i]) { max_a = a[j]; break; } } answer[i] = max_a; } for (int i = 0; i < n; ++i) { cout << " " << answer[i]; } cout << endl; } return 0; }