Borderou de evaluare (job #3362264)
| Utilizator | Data | 5 august 2026 12:17:55 | |
|---|---|---|---|
| Problema | Muzeu | Status | done |
| Runda | Arhiva de probleme | Compilator | cpp-64 | Vezi sursa |
| Scor | 0 | ||
Raport evaluator
Eroare de compilare:
main.cpp: In function 'int main()':
main.cpp:73:31: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&)'
73 | mat.resize(n, string(n));
| ^
In file included from /usr/include/c++/12.2.1/string:53,
from /usr/include/c++/12.2.1/bits/locale_classes.h:40,
from /usr/include/c++/12.2.1/bits/ios_base.h:41,
from /usr/include/c++/12.2.1/ios:42,
from /usr/include/c++/12.2.1/istream:38,
from /usr/include/c++/12.2.1/fstream:38,
from main.cpp:1:
/usr/include/c++/12.2.1/bits/basic_string.h:786:9: note: candidate: 'template<class _Tp, class> constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
786 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/12.2.1/bits/basic_string.h:786:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/12.2.1/bits/move.h:57,
from /usr/include/c++/12.2.1/bits/exception_ptr.h:43,
from /usr/include/c++/12.2.1/exception:168,
from /usr/include/c++/12.2.1/ios:39:
/usr/include/c++/12.2.1/type_traits: In substitution of 'template<bool _Cond, class _Tp> using enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/usr/include/c++/12.2.1/bits/basic_string.h:155:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using _If_sv = std::enable_if_t<std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value, _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
/usr/include/c++/12.2.1/bits/basic_string.h:783:30: required from here
/usr/include/c++/12.2.1/type_traits:2608:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2608 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
/usr/include/c++/12.2.1/bits/basic_string.h:774:9: note: candidate: 'template<class _Tp, class> constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
774 | basic_string(const _Tp& __t, size_type __pos, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/12.2.1/bits/basic_string.h:774:9: note: template argument deduction/substitution failed:
main.cpp:73:31: note: candidate expects 4 arguments, 1 provided
73 | mat.resize(n, string(n));
| ^
/usr/include/c++/12.2.1/bits/basic_string.h:751:9: note: candidate: 'template<class _InputIterator, class> constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
751 | basic_string(_InputIterator __beg, _InputIterator __end,
| ^~~~~~~~~~~~
/usr/include/c++/12.2.1/bits/basic_string.h:751:9: note: template argument deduction/substitution failed:
main.cpp:73:31: note: candidate expects 3 arguments, 1 provided
73 | mat.resize(n, string(n));
| ^
/usr/include/c++/12.2.1/bits/basic_string.h:657:7: note: candidate: 'template<class> constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
657 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/12.2.1/bits/basic_string.h:657:7: note: template argument deduction/substitution failed:
main.cpp:73:31: note: candidate expects 3 arguments, 1 provided
73 | mat.resize(n, string(n));
| ^
/usr/include/c++/12.2.1/bits/basic_string.h:634:7: note: candidate: 'template<class> constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
634 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/12.2.1/bits/basic_string.h:634:7: note: template argument deduction/substitution failed:
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !
