#397
Plopi1
De-a lungul principalei străzi din orașul nostru există n
plopi, pentru fiecare cunoscându-se înălțimea. Primarul orașului dorește să taie anumiți plopi, astfel încât înălțimile celor rămași să fie în ordine strict descrescătoare.
Determinați numărul minim de plopi care trebuie tăiați astfel încât înălțimile celor rămași să fie în ordine strict descrescătoare.
Problema | Plopi1 | Operații I/O |
plopi1.in /plopi1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #29531336 | Utilizator | |
Fișier | plopi1.cpp | Dimensiune | 587 B |
Data încărcării | 07 Mai 2021, 09:50 | Scor / rezultat | Eroare de compilare |
plopi1.cpp: In function 'int main()': plopi1.cpp:18:9: error: 'lg' was not declared in this scope lg[i]=1; ^ plopi1.cpp:20:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(v[i]>v=[j] and l[i]<l[j]+1) ^ plopi1.cpp: In lambda function: plopi1.cpp:20:27: error: expected '{' before 'and' token if(v[i]>v=[j] and l[i]<l[j]+1) ^ plopi1.cpp: In function 'int main()': plopi1.cpp:20:27: error: no match for 'operator&&' (operand types are 'main()::__lambda4' and 'bool') plopi1.cpp:20:27: note: candidates are: plopi1.cpp:20:27: note: operator&&(bool, bool) <built-in> plopi1.cpp:20:27: note: no known conversion for argument 1 from 'main()::__lambda4' to 'bool' In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from plopi1.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template<class _Dom1, class _Dom2> std::_Expr<std::_BinClos<std::__logical_and, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(&&, __logical_and) ^ /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template argument deduction/substitution failed: plopi1.cpp:20:41: note: 'main()::__lambda4' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' if(v[i]>v=[j] and l[i]<l[j]+1) ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from plopi1.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__logical_and, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&) _DEFINE_EXPR_BINARY_OPERATOR(&&, __logical_and) ^ /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template argument deduction/substitution failed: plopi1.cpp:20:41: note: 'main()::__lambda4' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' if(v[i]>v=[j] and l[i]<l[j]+1) ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from plopi1.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__logical_and, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(&&, __logical_and) ^ /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template argument deduction/substitution failed: plopi1.cpp:20:41: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'bool' if(v[i]>v=[j] and l[i]<l[j]+1) ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from plopi1.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__logical_and, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _Dom::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(&&, __logical_and) ^ /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template argument deduction/substitution failed: plopi1.cpp:20:41: note: 'main()::__lambda4' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' if(v[i]>v=[j] and l[i]<l[j]+1) ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from plopi1.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__logical_and, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__logical_and, typename _Dom1::value_type>::result_type> std::operator&&(const std::valarray<typename _Dom::value_type>&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(&&, __logical_and) ^ /usr/include/c++/4.8/bits/valarray_after.h:412:5: note: template argument deduction/substitution failed: plopi1.cpp:20:41: note: 'main()::__lambda4' is not derived from 'const std::valarray<typename _Dom::value_type>' if(v[i]>v=[j] and l[i]<l[j]+1) ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0, from plopi1.cpp:1: /usr/include/c++/4.8/valarray:1177:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__logical_and, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__logical_and, _Tp>::result_type> std::operator&&(const std::valarray<_Tp>&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(&&, __logical_and) ^ /usr/include/c++/4.8/valarray:1177:1: note: template argument deduction/substitution failed: plopi1.cpp:20:41: note: 'main()::__lambda4' is not derived from 'const std::valarray<_Tp>' if(v[i]>v=[j] and l[i]<l[j]+1) ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0, from plopi1.cpp:1: /usr/include/c++/4.8/valarray:1177:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__logical_and, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__logical_and, _Tp>::result_type> std::operator&&(const std::valarray<_Tp>&, const _Tp&) _DEFINE_BINARY_OPERATOR(&&, __logical_and) ^ /usr/include/c++/4.8/valarray:1177:1: note: template argument deduction/substitution failed: plopi1.cpp:20:41: note: 'main()::__lambda4' is not derived from 'const std::valarray<_Tp>' if(v[i]>v=[j] and l[i]<l[j]+1) ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0, from plopi1.cpp:1: /usr/include/c++/4.8/valarray:1177:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__logical_and, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__logical_and, _Tp>::result_type> std::operator&&(const _Tp&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(&&, __logical_and) ^ /usr/include/c++/4.8/valarray:1177:1: note: template argument deduction/substitution failed: plopi1.cpp:20:41: note: mismatched types 'const std::valarray<_Tp>' and 'bool' if(v[i]>v=[j] and l[i]<l[j]+1) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Plopi1 face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.