Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
main.cpp:31:25: warning: '&&' within '||' [-Wlogical-op-parentheses] if(s.size() && v[i]!=s.top() || !s.size()){ ~~~~~~~~~^~~~~~~~~~~~~~~~ ~~ main.cpp:31:25: note: place parentheses around the '&&' expression to silence this warning if(s.size() && v[i]!=s.top() || !s.size()){ ^ ( ) 1 warning generated. |
0.006 s | 3 KBi |
#2 |
Correcto
main.cpp:31:25: warning: '&&' within '||' [-Wlogical-op-parentheses] if(s.size() && v[i]!=s.top() || !s.size()){ ~~~~~~~~~^~~~~~~~~~~~~~~~ ~~ main.cpp:31:25: note: place parentheses around the '&&' expression to silence this warning if(s.size() && v[i]!=s.top() || !s.size()){ ^ ( ) 1 warning generated. |
0.006 s | 2 KBi |
#3 |
Correcto
main.cpp:31:25: warning: '&&' within '||' [-Wlogical-op-parentheses] if(s.size() && v[i]!=s.top() || !s.size()){ ~~~~~~~~~^~~~~~~~~~~~~~~~ ~~ main.cpp:31:25: note: place parentheses around the '&&' expression to silence this warning if(s.size() && v[i]!=s.top() || !s.size()){ ^ ( ) 1 warning generated. |
0.007 s | 54 KBi |
#4 |
Correcto
main.cpp:31:25: warning: '&&' within '||' [-Wlogical-op-parentheses] if(s.size() && v[i]!=s.top() || !s.size()){ ~~~~~~~~~^~~~~~~~~~~~~~~~ ~~ main.cpp:31:25: note: place parentheses around the '&&' expression to silence this warning if(s.size() && v[i]!=s.top() || !s.size()){ ^ ( ) 1 warning generated. |
0.007 s | 1 KBi |
#5 |
Correcto
main.cpp:31:25: warning: '&&' within '||' [-Wlogical-op-parentheses] if(s.size() && v[i]!=s.top() || !s.size()){ ~~~~~~~~~^~~~~~~~~~~~~~~~ ~~ main.cpp:31:25: note: place parentheses around the '&&' expression to silence this warning if(s.size() && v[i]!=s.top() || !s.size()){ ^ ( ) 1 warning generated. |
0.007 s | 2 KBi |
#6 |
Correcto
main.cpp:31:25: warning: '&&' within '||' [-Wlogical-op-parentheses] if(s.size() && v[i]!=s.top() || !s.size()){ ~~~~~~~~~^~~~~~~~~~~~~~~~ ~~ main.cpp:31:25: note: place parentheses around the '&&' expression to silence this warning if(s.size() && v[i]!=s.top() || !s.size()){ ^ ( ) 1 warning generated. |
0.263 s | 7 KBi |
#7 |
Correcto
main.cpp:31:25: warning: '&&' within '||' [-Wlogical-op-parentheses] if(s.size() && v[i]!=s.top() || !s.size()){ ~~~~~~~~~^~~~~~~~~~~~~~~~ ~~ main.cpp:31:25: note: place parentheses around the '&&' expression to silence this warning if(s.size() && v[i]!=s.top() || !s.size()){ ^ ( ) 1 warning generated. |
0.233 s | 6 KBi |
#8 |
Correcto
main.cpp:31:25: warning: '&&' within '||' [-Wlogical-op-parentheses] if(s.size() && v[i]!=s.top() || !s.size()){ ~~~~~~~~~^~~~~~~~~~~~~~~~ ~~ main.cpp:31:25: note: place parentheses around the '&&' expression to silence this warning if(s.size() && v[i]!=s.top() || !s.size()){ ^ ( ) 1 warning generated. |
0.394 s | 6 KBi |
#9 |
Correcto
main.cpp:31:25: warning: '&&' within '||' [-Wlogical-op-parentheses] if(s.size() && v[i]!=s.top() || !s.size()){ ~~~~~~~~~^~~~~~~~~~~~~~~~ ~~ main.cpp:31:25: note: place parentheses around the '&&' expression to silence this warning if(s.size() && v[i]!=s.top() || !s.size()){ ^ ( ) 1 warning generated. |
0.306 s | 20 KBi |
#10 |
Correcto
main.cpp:31:25: warning: '&&' within '||' [-Wlogical-op-parentheses] if(s.size() && v[i]!=s.top() || !s.size()){ ~~~~~~~~~^~~~~~~~~~~~~~~~ ~~ main.cpp:31:25: note: place parentheses around the '&&' expression to silence this warning if(s.size() && v[i]!=s.top() || !s.size()){ ^ ( ) 1 warning generated. |
0.356 s | 8 KBi |
/// Write by Daniel Perez .PERAPRO #include<bits/stdc++.h> using namespace std; #define fast_io ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); using vi=vector<int>; #define pb push_back typedef long long ll; int main(){ int T; cin>>T; for(int t=1;t<=T;t++){ int n; cin>>n; vi v(n); for(int i=0;i<n;i++) cin>>v[i]; stack<int> s; s.push(v[n-1]); vi ans(n); ans[n-1]=-1; for(int i=n-2;i>-1;i--){ while(s.size() && v[i]>=s.top()){ s.pop(); } if(s.size()){ ans[i]=s.top(); }else{ ans[i]=-1; } if(s.size() && v[i]!=s.top() || !s.size()){ s.push(v[i]); } } cout<<"Case #"<<t<<":"; for ( int i=0;i<n;i++) cout<<" "<<ans[i]; cout<<endl; } }