Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
main.cpp:38:26: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] for(int k =length-1;k=0;k--){ ~^~ main.cpp:38:26: note: place parentheses around the assignment to silence this warning for(int k =length-1;k=0;k--){ ^ ( ) main.cpp:38:26: note: use '==' to turn this assignment into an equality comparison for(int k =length-1;k=0;k--){ ^ == 1 warning generated. |
0.008 s | 2 KBi |
#2 |
Incorrecto
main.cpp:38:26: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] for(int k =length-1;k=0;k--){ ~^~ main.cpp:38:26: note: place parentheses around the assignment to silence this warning for(int k =length-1;k=0;k--){ ^ ( ) main.cpp:38:26: note: use '==' to turn this assignment into an equality comparison for(int k =length-1;k=0;k--){ ^ == 1 warning generated. |
0.007 s | 13 KBi |
#3 |
Incorrecto
main.cpp:38:26: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] for(int k =length-1;k=0;k--){ ~^~ main.cpp:38:26: note: place parentheses around the assignment to silence this warning for(int k =length-1;k=0;k--){ ^ ( ) main.cpp:38:26: note: use '==' to turn this assignment into an equality comparison for(int k =length-1;k=0;k--){ ^ == 1 warning generated. |
0.007 s | 12 KBi |
#4 |
Incorrecto
main.cpp:38:26: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] for(int k =length-1;k=0;k--){ ~^~ main.cpp:38:26: note: place parentheses around the assignment to silence this warning for(int k =length-1;k=0;k--){ ^ ( ) main.cpp:38:26: note: use '==' to turn this assignment into an equality comparison for(int k =length-1;k=0;k--){ ^ == 1 warning generated. |
0.006 s | 16 KBi |
#5 |
Incorrecto
main.cpp:38:26: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] for(int k =length-1;k=0;k--){ ~^~ main.cpp:38:26: note: place parentheses around the assignment to silence this warning for(int k =length-1;k=0;k--){ ^ ( ) main.cpp:38:26: note: use '==' to turn this assignment into an equality comparison for(int k =length-1;k=0;k--){ ^ == 1 warning generated. |
0.007 s | 19 KBi |
#6 |
Incorrecto
main.cpp:38:26: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] for(int k =length-1;k=0;k--){ ~^~ main.cpp:38:26: note: place parentheses around the assignment to silence this warning for(int k =length-1;k=0;k--){ ^ ( ) main.cpp:38:26: note: use '==' to turn this assignment into an equality comparison for(int k =length-1;k=0;k--){ ^ == 1 warning generated. |
0.171 s | 7 KBi |
#7 |
Incorrecto
main.cpp:38:26: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] for(int k =length-1;k=0;k--){ ~^~ main.cpp:38:26: note: place parentheses around the assignment to silence this warning for(int k =length-1;k=0;k--){ ^ ( ) main.cpp:38:26: note: use '==' to turn this assignment into an equality comparison for(int k =length-1;k=0;k--){ ^ == 1 warning generated. |
0.162 s | 6 KBi |
#8 |
Incorrecto
main.cpp:38:26: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] for(int k =length-1;k=0;k--){ ~^~ main.cpp:38:26: note: place parentheses around the assignment to silence this warning for(int k =length-1;k=0;k--){ ^ ( ) main.cpp:38:26: note: use '==' to turn this assignment into an equality comparison for(int k =length-1;k=0;k--){ ^ == 1 warning generated. |
0.297 s | 7 KBi |
#9 |
Incorrecto
main.cpp:38:26: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] for(int k =length-1;k=0;k--){ ~^~ main.cpp:38:26: note: place parentheses around the assignment to silence this warning for(int k =length-1;k=0;k--){ ^ ( ) main.cpp:38:26: note: use '==' to turn this assignment into an equality comparison for(int k =length-1;k=0;k--){ ^ == 1 warning generated. |
0.162 s | 7 KBi |
#10 |
Incorrecto
main.cpp:38:26: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] for(int k =length-1;k=0;k--){ ~^~ main.cpp:38:26: note: place parentheses around the assignment to silence this warning for(int k =length-1;k=0;k--){ ^ ( ) main.cpp:38:26: note: use '==' to turn this assignment into an equality comparison for(int k =length-1;k=0;k--){ ^ == 1 warning generated. |
0.21 s | 7 KBi |
#include <iostream> #include <vector> #include <stack> using namespace std; void horizontes(int length,vector<int> a,vector<int> &soluc); int main(){ int numCases; cin >> numCases; for(int i=0;i<numCases;++i){ int length; cin >> length; vector<int> a(length); vector<int> soluc(length); for(int j=0;j<length;j++){ cin >> a[j]; } horizontes(length,a,soluc); //printar cout << "Case #"<< i + 1 << ": "; for(int j=0;j<length;j++){ cout << soluc[j] << " "; } cout << "\n"; } } void horizontes(int length,vector<int> a, vector<int> &soluc){ stack<int> blockers; for(int k =length-1;k=0;k--){ while(!blockers.empty() && a[k]>=blockers.top()){ blockers.pop(); } if (!blockers.empty()){ soluc[k]=-1; }else{ soluc[k]= blockers.top(); } } // for(int k =0;k<length;k++){ // bool blocked = false; // int j = k+1; // while(!blocked && j<length+1){ // if(a[j]>a[k]){ // blocked = true; // soluc[k]=a[j]; // } // j++; // } // if(j==length+1){ // soluc[k]=-1; // } // } }