#3731
tunel2
C++
Tommy este un motan alintat care adoră să se plimbe prin orice tunel. De aceea, stăpânii lui i-au construit o nouă jucărie, formată din N
tuneluri interconectate (etichetate cu numerele distincte de la 1
la N
. Toate tunelurile au aceeași lungime, sunt formate din M
elemente unitare identice (numerotate cu numerele distincte de la 1
la M
) și au ieșiri la ambele capete. Conectarea dintre două tuneluri alăturate se face printr-un element unitar numit pasaj.
Pentru a fi mai provocator, stăpânii motanului plasează în ultimul element unitar al ultimului tunel o recompensă.
Ajutați-l pe Tommy să ajungă cât mai repede la recompensă respectând regulile jocului!
Problema | tunel2 | Operații I/O |
![]() tunel2.in /tunel2.out
|
---|---|---|---|
Limita timp | 0.07 secunde | Limita memorie |
Total: 39 MB
/
Stivă 39 MB
|
Id soluție | #56487407 | Utilizator | |
Fișier | tunel2.cpp | Dimensiune | 3.06 KB |
Data încărcării | 21 Februarie 2025, 15:53 | Scor / rezultat | Eroare de compilare |
tunel2.cpp: In function 'int simulateExit(int, int, int, std::vector<TunnelPassages>&)': tunel2.cpp:26:69: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' if (find(lastPassages.begin(), lastPassages.end(), M) != lastPassages.end()) { ^ tunel2.cpp:26:69: note: candidate is: In file included from /usr/include/c++/4.8/bits/locale_facets.h:48:0, from /usr/include/c++/4.8/bits/basic_ios.h:37, from /usr/include/c++/4.8/ios:44, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from tunel2.cpp:1: /usr/include/c++/4.8/bits/streambuf_iterator.h:369:5: note: template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, const _CharT2&) find(istreambuf_iterator<_CharT> __first, ^ /usr/include/c++/4.8/bits/streambuf_iterator.h:369:5: note: template argument deduction/substitution failed: tunel2.cpp:26:69: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' if (find(lastPassages.begin(), lastPassages.end(), M) != lastPassages.end()) { ^ tunel2.cpp:37:75: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' if (find(currPassages.begin(), currPassages.end(), currentPosition) != currPassages.end()) { ^ tunel2.cpp:37:75: note: candidate is: In file included from /usr/include/c++/4.8/bits/locale_facets.h:48:0, from /usr/include/c++/4.8/bits/basic_ios.h:37, from /usr/include/c++/4.8/ios:44, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from tunel2.cpp:1: /usr/include/c++/4.8/bits/streambuf_iterator.h:369:5: note: template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, const _CharT2&) find(istreambuf_iterator<_CharT> __first, ^ /usr/include/c++/4.8/bits/streambuf_iterator.h:369:5: note: template argument deduction/substitution failed: tunel2.cpp:37:75: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' if (find(currPassages.begin(), currPassages.end(), currentPosition) != currPassages.end()) { ^ tunel2.cpp: In function 'int findMinimalElements(int, int, std::vector<TunnelPassages>&)': tunel2.cpp:52:102: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' if (N > 1 && find(passages[N-2].passagePositions.begin(), passages[N-2].passagePositions.end(), M) != passages[N-2].passagePositions.end()) { ^ tunel2.cpp:52:102: note: candidate is: In file included from /usr/include/c++/4.8/bits/locale_facets.h:48:0, from /usr/include/c++/4.8/bits/basic_ios.h:37, from /usr/include/c++/4.8/ios:44, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from tunel2.cpp:1: /usr/include/c++/4.8/bits/streambuf_iterator.h:369:5: note: template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, const _CharT2&) find(istreambuf_iterator<_CharT> __first, ^ /usr/include/c++/4.8/bits/streambuf_iterator.h:369:5: note: template argument deduction/substitution failed: tunel2.cpp:52:102: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' if (N > 1 && find(passages[N-2].passagePositions.begin(), passages[N-2].passagePositions.end(), M) != passages[N-2].passagePositions.end()) { ^ tunel2.cpp:58:97: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' if (find(passages[N-2].passagePositions.begin(), passages[N-2].passagePositions.end(), i) != passages[N-2].passagePositions.end()) { ^ tunel2.cpp:58:97: note: candidate is: In file included from /usr/include/c++/4.8/bits/locale_facets.h:48:0, from /usr/include/c++/4.8/bits/basic_ios.h:37, from /usr/include/c++/4.8/ios:44, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from tunel2.cpp:1: /usr/include/c++/4.8/bits/streambuf_iterator.h:369:5: note: template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, const _CharT2&) find(istreambuf_iterator<_CharT> __first, ^ /usr/include/c++/4.8/bits/streambuf_iterator.h:369:5: note: template argument deduction/substitution failed: tunel2.cpp:58:97: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' if (find(passages[N-2].passagePositions.begin(), passages[N-2].passagePositions.end(), i) != passages[N-2].passagePositions.end()) { ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema tunel2 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ă.