#3942
fazan
Se dau n
cuvinte formate din litere mici și un număr m
. Afișați în ordine lexicografică toate șirurile de m cuvinte dintre cele date, care respectă regula jocului Fazan
.
Problema | fazan | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #35470355 | Utilizator | |
Fișier | fazan.cpp | Dimensiune | 966 B |
Data încărcării | 10 Martie 2022, 13:53 | Scor / rezultat | Eroare de compilare |
fazan.cpp:36:14: warning: multi-character character constant [-Wmultichar] cin>>'a[i]' ^ fazan.cpp: In function 'int valid(int)': fazan.cpp:19:40: error: 'strelen' was not declared in this scope int l=strelen(a[s[k]],a[s[k-1]]) return 0; ^ fazan.cpp:19:13: warning: unused variable 'l' [-Wunused-variable] int l=strelen(a[s[k]],a[s[k-1]]) return 0; ^ fazan.cpp: In function 'void backt(int)': fazan.cpp:29:13: error: expected ';' before 'else' else backt(k+1); ^ fazan.cpp: In function 'int main()': fazan.cpp:36:12: error: ambiguous overload for 'operator>>' (operand types are 'std::istream {aka std::basic_istream<char>}' and 'int') cin>>'a[i]' ^ fazan.cpp:36:12: note: candidates are: In file included from /usr/include/c++/4.8/iostream:40:0, from fazan.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>*}' fazan.cpp:37:9: error: expected ';' before 'for' for(int i=1; i,n;i++ ^ fazan.cpp:37:22: error: 'i' was not declared in this scope for(int i=1; i,n;i++ ^ fazan.cpp:38:13: error: expected ';' before 'for' for(int j=i+1; j<=n;j++) ^ fazan.cpp:38:28: error: 'j' was not declared in this scope for(int j=i+1; j<=n;j++) ^ fazan.cpp:38:36: error: expected ';' before ')' token for(int j=i+1; j<=n;j++) ^ fazan.cpp:47:13: error: expected '}' at end of input } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema fazan 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ă.