Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.007 s | 1 KBi |
#2 |
Incorrecto
|
0.006 s | 1 KBi |
#3 |
Incorrecto
|
0.005 s | 1 KBi |
#4 |
Incorrecto
|
0.006 s | 1 KBi |
#5 |
Incorrecto
|
0.006 s | 1 KBi |
#6 |
Incorrecto
|
0.104 s | 7 KBi |
#7 |
Incorrecto
|
0.092 s | 6 KBi |
#8 |
Incorrecto
|
0.114 s | 6 KBi |
#9 |
Incorrecto
|
0.098 s | 6 KBi |
#10 |
Incorrecto
|
0.133 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<<endl; cout<<"Case #"<<p<<": "; while( !s.empty() ) { cout<<s.top()<<" "; s.pop(); } } }