#3888
PalSplit
Avem un vector de n
elemente naturale nenule. O operație constă în alegerea unei subsecvențe (elemente adiacente) palindromice și eliminarea ei din vector, în urma eliminării elementele rămase se vor restrânge. Care este numărul minim de operații necesar pentru a elimina toate elementele?
codeforces, Div1. #336
Problema | PalSplit | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.05 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
Id soluție | #48331513 | Utilizator | |
Fișier | palsplit.cpp | Dimensiune | 139 B |
Data încărcării | 22 Ianuarie 2024, 13:15 | Scor / rezultat | Eroare de compilare |
palsplit.cpp: In function 'int main()': palsplit.cpp:7:8: error: ambiguous overload for 'operator>>' (operand types are 'std::istream {aka std::basic_istream<char>}' and 'int') cin>>1 ,2 ,3 ,2 ,2 ,1; ^ palsplit.cpp:7:8: note: candidates are: In file included from /usr/include/c++/4.8/iostream:40:0, from palsplit.cpp:1: /usr/include/c++/4.8/istream:120:7: note: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::basic_istream<_CharT, _Traits>::__istream_type& (*)(std::basic_istream<_CharT, _Traits>::__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>] <near match> operator>>(__istream_type& (*__pf)(__istream_type&)) ^ /usr/include/c++/4.8/istream:120:7: note: no known conversion for argument 1 from 'int' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&) {aka std::basic_istream<char>& (*)(std::basic_istream<char>&)}' /usr/include/c++/4.8/istream:124:7: note: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::basic_istream<_CharT, _Traits>::__ios_type& (*)(std::basic_istream<_CharT, _Traits>::__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>; std::basic_istream<_CharT, _Traits>::__ios_type = std::basic_ios<char>] <near match> operator>>(__ios_type& (*__pf)(__ios_type&)) ^ /usr/include/c++/4.8/istream:124:7: note: no known conversion for argument 1 from 'int' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&) {aka std::basic_ios<char>& (*)(std::basic_ios<char>&)}' /usr/include/c++/4.8/istream:131:7: note: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>] <near match> operator>>(ios_base& (*__pf)(ios_base&)) ^ /usr/include/c++/4.8/istream:131:7: note: no known conversion for argument 1 from 'int' to 'std::ios_base& (*)(std::ios_base&)' /usr/include/c++/4.8/istream:259:7: note: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(std::basic_istream<_CharT, _Traits>::__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>] <near match> operator>>(__streambuf_type* __sb); ^ /usr/include/c++/4.8/istream:259:7: note: no known conversion for argument 1 from 'int' to 'std::basic_istream<char>::__streambuf_type* {aka std::basic_streambuf<char>*}' palsplit.cpp:8:15: error: expected primary-expression before ',' token cout << 2;, ^ palsplit.cpp:9:5: error: expected primary-expression before 'return' return 0; ^ palsplit.cpp:9:5: error: expected ';' before 'return'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PalSplit 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ă.