Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.007 s | 1 KBi |
#2 |
Incorrecto
|
0.007 s | 1 KBi |
#3 |
Correcto
|
0.007 s | 1 KBi |
#4 |
Correcto
|
0.007 s | 1 KBi |
#5 |
Incorrecto
|
0.006 s | 1 KBi |
#6 |
Incorrecto
|
0.094 s | 6 KBi |
#7 |
Correcto
|
0.118 s | 6 KBi |
#8 |
Correcto
|
0.118 s | 6 KBi |
#9 |
Incorrecto
|
0.129 s | 6 KBi |
#10 |
Incorrecto
|
0.105 s | 8 KBi |
#include <iostream> #include <cstring> #include <cstdio> #include <cmath> #include <queue> #include <set> #include <map> #include <vector> #include <stack> #include <algorithm> #define forn(a, n) for(int a = 0; a<(int) (n); ++a) #define rforn(a, n) for(int a = (n)-1; a>=0; --a) using namespace std; const int N = 6e5+20; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int c, n; cin>>c; for(int p = 1; p <= c; p++) { int a [500001]; stack <int> s; cin>>n; for(int i = 0; i < n; i++) { cin>>a[i]; } int max = 0; for(int i = n-1; i >= 0; i--) { if(a[i] >= max) { max = a[i]; s.push(-1); } else s.push(max); } cout<<"Case #"<<p<<": "; while( !s.empty() ) { cout<<s.top()<<" "; s.pop(); } cout<<endl; } }