#3960
Dându-se mai multe șiruri crescătoare de numere naturale, fiecare astfel de șir terminându-se cu numărul 0, se cere să se afișeze în ordine strict crescătoare, numerele comune tuturor șirurilor.
ad-hoc
| Problema | intersectie_siruri | Operații I/O |
intersectie.in/intersectie.out
|
|---|---|---|---|
| Limita timp | 0.4 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
| Id soluție | #64795537 | Utilizator | |
| Fișier | intersectie_siruri.cpp | Dimensiune | 931 B |
| Data încărcării | 01 Iunie 2026, 21:25 | Scor/rezultat | Eroare de compilare |
intersectie_siruri.cpp: In function ‘int main()’: intersectie_siruri.cpp:12:12: error: no match for ‘operator!=’ (operand types are ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} and ‘int’) 12 | while(x!=0) | ~^~~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/13/iosfwd:42, from /usr/include/c++/13/ios:40, from /usr/include/c++/13/istream:40, from /usr/include/c++/13/fstream:40, from intersectie_siruri.cpp:1: /usr/include/c++/13/bits/postypes.h:197:5: note: candidate: ‘template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)’ 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/13/bits/postypes.h:197:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:12:14: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::fpos<_StateT>’ 12 | while(x!=0) | ^ In file included from /usr/include/c++/13/string:43, from /usr/include/c++/13/bits/locale_classes.h:40, from /usr/include/c++/13/bits/ios_base.h:41, from /usr/include/c++/13/ios:44: /usr/include/c++/13/bits/allocator.h:245:5: note: candidate: ‘template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)’ 245 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/13/bits/allocator.h:245:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:12:14: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::allocator<_CharT>’ 12 | while(x!=0) | ^ In file included from /usr/include/c++/13/string:48: /usr/include/c++/13/bits/stl_iterator.h:462:5: note: candidate: ‘template<class _Iterator> bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)’ 462 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:12:14: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::reverse_iterator<_Iterator>’ 12 | while(x!=0) | ^ /usr/include/c++/13/bits/stl_iterator.h:507:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)’ 507 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:12:14: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::reverse_iterator<_Iterator>’ 12 | while(x!=0) | ^ /usr/include/c++/13/bits/stl_iterator.h:1697:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)’ 1697 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:1697:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:12:14: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::move_iterator<_IteratorL>’ 12 | while(x!=0) | ^ /usr/include/c++/13/bits/stl_iterator.h:1763:5: note: candidate: ‘template<class _Iterator> bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)’ 1763 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:1763:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:12:14: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::move_iterator<_IteratorL>’ 12 | while(x!=0) | ^ In file included from /usr/include/c++/13/bits/stl_algobase.h:64, from /usr/include/c++/13/string:51: /usr/include/c++/13/bits/stl_pair.h:842:5: note: candidate: ‘template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)’ 842 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/13/bits/stl_pair.h:842:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:12:14: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::pair<_T1, _T2>’ 12 | while(x!=0) | ^ In file included from /usr/include/c++/13/string:54: /usr/include/c++/13/bits/basic_string.h:3788:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’ 3788 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3788:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:12:14: note: mismatched types ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ and ‘int’ 12 | while(x!=0) | ^ /usr/include/c++/13/bits/basic_string.h:3802:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’ 3802 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3802:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:12:14: note: mismatched types ‘const _CharT*’ and ‘std::__cxx11::basic_string<char>’ 12 | while(x!=0) | ^ /usr/include/c++/13/bits/basic_string.h:3815:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)’ 3815 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3815:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:12:14: note: mismatched types ‘const _CharT*’ and ‘int’ 12 | while(x!=0) | ^ In file included from /usr/include/c++/13/bits/locale_facets.h:48, from /usr/include/c++/13/bits/basic_ios.h:37, from /usr/include/c++/13/ios:46: /usr/include/c++/13/bits/streambuf_iterator.h:242:5: note: candidate: ‘template<class _CharT, class _Traits> bool std::operator!=(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)’ 242 | operator!=(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/13/bits/streambuf_iterator.h:242:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:12:14: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::istreambuf_iterator<_CharT, _Traits>’ 12 | while(x!=0) | ^ In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/c++allocator.h:33, from /usr/include/c++/13/bits/allocator.h:46: /usr/include/c++/13/bits/new_allocator.h:222:9: note: candidate: ‘template<class _Up> bool std::operator!=(const __new_allocator<char>&, const __new_allocator<_Tp>&)’ 222 | operator!=(const __new_allocator&, const __new_allocator<_Up>&) | ^~~~~~~~ /usr/include/c++/13/bits/new_allocator.h:222:9: note: template argument deduction/substitution failed: intersectie_siruri.cpp:12:14: note: mismatched types ‘const std::__new_allocator<_Tp>’ and ‘int’ 12 | while(x!=0) | ^ In file included from /usr/include/c++/13/bits/ios_base.h:46: /usr/include/c++/13/system_error:525:3: note: candidate: ‘bool std::operator!=(const error_code&, const error_code&)’ 525 | operator!=(const error_code& __lhs, const error_code& __rhs) noexcept | ^~~~~~~~ /usr/include/c++/13/system_error:525:32: note: no known conversion for argument 1 from ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘const std::error_code&’ 525 | operator!=(const error_code& __lhs, const error_code& __rhs) noexcept | ~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/13/system_error:530:3: note: candidate: ‘bool std::operator!=(const error_code&, const error_condition&)’ 530 | operator!=(const error_code& __lhs, const error_condition& __rhs) noexcept | ^~~~~~~~ /usr/include/c++/13/system_error:530:32: note: no known conversion for argument 1 from ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘const std::error_code&’ 530 | operator!=(const error_code& __lhs, const error_condition& __rhs) noexcept | ~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/13/system_error:535:3: note: candidate: ‘bool std::operator!=(const error_condition&, const error_code&)’ 535 | operator!=(const error_condition& __lhs, const error_code& __rhs) noexcept | ^~~~~~~~ /usr/include/c++/13/system_error:535:37: note: no known conversion for argument 1 from ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘const std::error_condition&’ 535 | operator!=(const error_condition& __lhs, const error_code& __rhs) noexcept | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/13/system_error:540:3: note: candidate: ‘bool std::operator!=(const error_condition&, const error_condition&)’ 540 | operator!=(const error_condition& __lhs, | ^~~~~~~~ /usr/include/c++/13/system_error:540:37: note: no known conversion for argument 1 from ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘const std::error_condition&’ 540 | operator!=(const error_condition& __lhs, | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/13/bits/allocator.h:222:7: note: candidate: ‘bool std::operator!=(const allocator<char>&, const allocator<char>&)’ 222 | operator!=(const allocator&, const allocator&) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/13/bits/allocator.h:222:18: note: no known conversion for argument 1 from ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘const std::allocator<char>&’ 222 | operator!=(const allocator&, const allocator&) _GLIBCXX_NOTHROW | ^~~~~~~~~~~~~~~~ intersectie_siruri.cpp:22:16: error: no match for ‘operator!=’ (operand types are ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} and ‘int’) 22 | while(x!=0) | ~^~~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} /usr/include/c++/13/bits/postypes.h:197:5: note: candidate: ‘template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)’ 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/13/bits/postypes.h:197:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:22:18: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::fpos<_StateT>’ 22 | while(x!=0) | ^ /usr/include/c++/13/bits/allocator.h:245:5: note: candidate: ‘template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)’ 245 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/13/bits/allocator.h:245:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:22:18: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::allocator<_CharT>’ 22 | while(x!=0) | ^ /usr/include/c++/13/bits/stl_iterator.h:462:5: note: candidate: ‘template<class _Iterator> bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)’ 462 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:22:18: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::reverse_iterator<_Iterator>’ 22 | while(x!=0) | ^ /usr/include/c++/13/bits/stl_iterator.h:507:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)’ 507 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:22:18: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::reverse_iterator<_Iterator>’ 22 | while(x!=0) | ^ /usr/include/c++/13/bits/stl_iterator.h:1697:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)’ 1697 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:1697:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:22:18: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::move_iterator<_IteratorL>’ 22 | while(x!=0) | ^ /usr/include/c++/13/bits/stl_iterator.h:1763:5: note: candidate: ‘template<class _Iterator> bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)’ 1763 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:1763:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:22:18: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::move_iterator<_IteratorL>’ 22 | while(x!=0) | ^ /usr/include/c++/13/bits/stl_pair.h:842:5: note: candidate: ‘template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)’ 842 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/13/bits/stl_pair.h:842:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:22:18: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::pair<_T1, _T2>’ 22 | while(x!=0) | ^ /usr/include/c++/13/bits/basic_string.h:3788:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’ 3788 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3788:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:22:18: note: mismatched types ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ and ‘int’ 22 | while(x!=0) | ^ /usr/include/c++/13/bits/basic_string.h:3802:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’ 3802 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3802:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:22:18: note: mismatched types ‘const _CharT*’ and ‘std::__cxx11::basic_string<char>’ 22 | while(x!=0) | ^ /usr/include/c++/13/bits/basic_string.h:3815:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)’ 3815 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3815:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:22:18: note: mismatched types ‘const _CharT*’ and ‘int’ 22 | while(x!=0) | ^ /usr/include/c++/13/bits/streambuf_iterator.h:242:5: note: candidate: ‘template<class _CharT, class _Traits> bool std::operator!=(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)’ 242 | operator!=(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/13/bits/streambuf_iterator.h:242:5: note: template argument deduction/substitution failed: intersectie_siruri.cpp:22:18: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::istreambuf_iterator<_CharT, _Traits>’ 22 | while(x!=0) | ^ /usr/include/c++/13/bits/new_allocator.h:222:9: note: candidate: ‘template<class _Up> bool std::operator!=(const __new_allocator<char>&, const __new_allocator<_Tp>&)’ 222 | operator!=(const __new_allocator&, const __new_allocator<_Up>&) | ^~~~~~~~ /usr/include/c++/13/bits/new_allocator.h:222:9: note: template argument deduction/substitution failed: intersectie_siruri.cpp:22:18: note: mismatched types ‘const std::__new_allocator<_Tp>’ and ‘int’ 22 | while(x!=0) | ^ /usr/include/c++/13/system_error:525:3: note: candidate: ‘bool std::operator!=(const error_code&, const error_code&)’ 525 | operator!=(const error_code& __lhs, const error_code& __rhs) noexcept | ^~~~~~~~ /usr/include/c++/13/system_error:525:32: note: no known conversion for argument 1 from ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘const std::error_code&’ 525 | operator!=(const error_code& __lhs, const error_code& __rhs) noexcept | ~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/13/system_error:530:3: note: candidate: ‘bool std::operator!=(const error_code&, const error_condition&)’ 530 | operator!=(const error_code& __lhs, const error_condition& __rhs) noexcept | ^~~~~~~~ /usr/include/c++/13/system_error:530:32: note: no known conversion for argument 1 from ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘const std::error_code&’ 530 | operator!=(const error_code& __lhs, const error_condition& __rhs) noexcept | ~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/13/system_error:535:3: note: candidate: ‘bool std::operator!=(const error_condition&, const error_code&)’ 535 | operator!=(const error_condition& __lhs, const error_code& __rhs) noexcept | ^~~~~~~~ /usr/include/c++/13/system_error:535:37: note: no known conversion for argument 1 from ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘const std::error_condition&’ 535 | operator!=(const error_condition& __lhs, const error_code& __rhs) noexcept | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/13/system_error:540:3: note: candidate: ‘bool std::operator!=(const error_condition&, const error_condition&)’ 540 | operator!=(const error_condition& __lhs, | ^~~~~~~~ /usr/include/c++/13/system_error:540:37: note: no known conversion for argument 1 from ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘const std::error_condition&’ 540 | operator!=(const error_condition& __lhs, | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/13/bits/allocator.h:222:7: note: candidate: ‘bool std::operator!=(const allocator<char>&, const allocator<char>&)’ 222 | operator!=(const allocator&, const allocator&) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/13/bits/allocator.h:222:18: note: no known conversion for argument 1 from ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘const std::allocator<char>&’ 222 | operator!=(const allocator&, const allocator&) _GLIBCXX_NOTHROW | ^~~~~~~~~~~~~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema intersectie_siruri 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ă.