Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Error en tiempo de ejecución (NZEC)
Exited with error status 139 run: line 1: 3 Segmentation fault (core dumped) ./a.out |
0.005 s | 6 KBi |
#2 |
Error en tiempo de ejecución (NZEC)
Exited with error status 139 run: line 1: 3 Segmentation fault (core dumped) ./a.out |
0.005 s | 1 KBi |
#3 |
Error en tiempo de ejecución (NZEC)
Exited with error status 139 run: line 1: 3 Segmentation fault (core dumped) ./a.out |
0.005 s | 1 KBi |
#4 |
Error en tiempo de ejecución (NZEC)
Exited with error status 139 run: line 1: 3 Segmentation fault (core dumped) ./a.out |
0.006 s | 2 KBi |
#5 |
Error en tiempo de ejecución (NZEC)
Exited with error status 139 run: line 1: 3 Segmentation fault (core dumped) ./a.out |
0.006 s | 14 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.005 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.005 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.005 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.005 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.006 s | 1 KBi |
#include <iostream> #include <vector> using namespace std; void solve() { int n; vector<int> a(n); vector<int> answer(n); 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; } int main() { int cases; cin >> cases; for (int c = 1; c <= cases; c++) { cout << "Case #" << c << ":"; solve(); } }