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 |
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 |
#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.006 s | 1 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.006 s | 1 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.147 s | 17 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.139 s | 22 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.246 s | 17 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.144 s | 21 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.208 s | 18 KBi |
#include <iostream> #include <algorithm> // std::max #include <bits/stdc++.h> #include <list> using namespace std; int main() { int c; cin >> c; for(int j = 0;j<c;j++){ int N; cin >> N; int array[N]; int solve[N]; for(int i = 0;i<N;i++) { cin >> array[i]; } list<int> l(N); 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]); } } cout << "Case #" << (j+1) << ":"; for(int i = 0;i<N;i++) cout << " " << solve[i]; cout << endl; } return 0; }