#2803
ElimP
Se citește un număr p
și un șir de caractere s
, șirul conține cel mult 255
de litere mici ale alfabetului englez. Să se afișeze toate șirurile rezultate din eliminarea, pe rând, a fiecărei secvențe de p
caractere din s
.
Problema | ElimP | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50611997 | Utilizator | |
Fișier | elimp.cpp | Dimensiune | 726 B |
Data încărcării | 17 Aprilie 2024, 09:59 | Scor / rezultat | Eroare de compilare |
elimp.cpp: In function 'int main()': elimp.cpp:21:28: error: no matching function for call to 'std::basic_string<char>::erase(__gnu_cxx::__normal_iterator<char*, std::basic_string<char> >, int&)' c.erase(c.begin()+i ,n); ^ elimp.cpp:21:28: note: candidates are: In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from elimp.cpp:9: /usr/include/c++/4.8/bits/basic_string.h:1362:7: note: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::erase(std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = unsigned int] erase(size_type __pos = 0, size_type __n = npos) ^ /usr/include/c++/4.8/bits/basic_string.h:1362:7: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<char*, std::basic_string<char> >' to 'std::basic_string<char>::size_type {aka unsigned int}' /usr/include/c++/4.8/bits/basic_string.h:1378:7: note: std::basic_string<_CharT, _Traits, _Alloc>::iterator std::basic_string<_CharT, _Traits, _Alloc>::erase(std::basic_string<_CharT, _Traits, _Alloc>::iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc>::iterator = __gnu_cxx::__normal_iterator<char*, std::basic_string<char> >; typename _Alloc::rebind<_CharT>::other::pointer = char*] erase(iterator __position) ^ /usr/include/c++/4.8/bits/basic_string.h:1378:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/4.8/bits/basic_string.h:1398:7: note: std::basic_string<_CharT, _Traits, _Alloc>::iterator std::basic_string<_CharT, _Traits, _Alloc>::erase(std::basic_string<_CharT, _Traits, _Alloc>::iterator, std::basic_string<_CharT, _Traits, _Alloc>::iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc>::iterator = __gnu_cxx::__normal_iterator<char*, std::basic_string<char> >; typename _Alloc::rebind<_CharT>::other::pointer = char*] erase(iterator __first, iterator __last); ^ /usr/include/c++/4.8/bits/basic_string.h:1398:7: note: no known conversion for argument 2 from 'int' to 'std::basic_string<char>::iterator {aka __gnu_cxx::__normal_iterator<char*, std::basic_string<char> >}'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ElimP 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ă.