Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Error en tiempo de ejecución (NZEC)
Exited with error status 134 free(): invalid pointer run: line 1: 3 Aborted (core dumped) ./a.out |
0.005 s | 1 KBi |
#2 |
Incorrecto
|
0.005 s | 1 KBi |
#3 |
Error en tiempo de ejecución (NZEC)
Exited with error status 134 free(): invalid pointer run: line 1: 3 Aborted (core dumped) ./a.out |
0.005 s | 4 KBi |
#4 |
Error en tiempo de ejecución (NZEC)
Exited with error status 134 free(): invalid pointer run: line 1: 3 Aborted (core dumped) ./a.out |
0.005 s | 5 KBi |
#5 |
Error en tiempo de ejecución (NZEC)
Exited with error status 134 free(): invalid pointer run: line 1: 3 Aborted (core dumped) ./a.out |
0.005 s | 1 KBi |
#6 |
Error en tiempo de ejecución (NZEC)
Exited with error status 134 free(): invalid pointer run: line 1: 3 Aborted (core dumped) ./a.out |
0.074 s | 3 KBi |
#7 |
Error en tiempo de ejecución (NZEC)
Exited with error status 134 free(): invalid pointer run: line 1: 3 Aborted (core dumped) ./a.out |
0.058 s | 5 KBi |
#8 |
Error en tiempo de ejecución (NZEC)
Exited with error status 134 free(): invalid pointer run: line 1: 3 Aborted (core dumped) ./a.out |
0.168 s | 3 KBi |
#9 |
Error en tiempo de ejecución (NZEC)
Exited with error status 134 free(): invalid pointer run: line 1: 3 Aborted (core dumped) ./a.out |
0.071 s | 3 KBi |
#10 |
Error en tiempo de ejecución (NZEC)
Exited with error status 134 free(): invalid pointer run: line 1: 3 Aborted (core dumped) ./a.out |
0.128 s | 3 KBi |
#include <iostream> #include <algorithm> // std::max #include <bits/stdc++.h> #include <list> using namespace std; int main() { int c; cin >> c; for(int i = 0;i<c;i++){ int N; cin >> N; int array[N]; int solve[N]; for(int i = 0;i<N;i++) { cin >> array[i]; } list<int> l; for(int i = N-1;i>=0;i--){ if(l.size() > 0 ){ while(array[i]>=l.front()){ l.pop_front(); } if(l.size() == 0){ solve[i] = -1; l.push_front(array[i]); }else{ solve[i] = l.front(); l.push_front(array[i]); } }else{ solve[i] = -1; l.push_front(array[i]); } } for(int i = 0;i<N;i++) cout << solve[i] << " "; l.clear(); } return 0; }