QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#77829#1194. Parehtneses Editorybw051114#Compile Error//C++145.2kb2023-02-15 17:40:462023-02-15 17:40:48

Details

answer.code: In function ‘int main()’:
answer.code:218:17: error: no match for ‘operator=’ (operand types are ‘std::unordered_map<int, int>’ and ‘int’)
  218 |         su[0] = 1;
      |                 ^
In file included from /usr/include/c++/11/unordered_map:47,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:117,
                 from answer.code:11:
/usr/include/c++/11/bits/unordered_map.h:272:7: note: candidate: ‘std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(const std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&) [with _Key = int; _Tp = int; _Hash = std::hash<int>; _Pred = std::equal_to<int>; _Alloc = std::allocator<std::pair<const int, int> >]’
  272 |       operator=(const unordered_map&) = default;
      |       ^~~~~~~~
/usr/include/c++/11/bits/unordered_map.h:272:17: note:   no known conversion for argument 1 from ‘int’ to ‘const std::unordered_map<int, int>&’
  272 |       operator=(const unordered_map&) = default;
      |                 ^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/11/bits/unordered_map.h:276:7: note: candidate: ‘std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&&) [with _Key = int; _Tp = int; _Hash = std::hash<int>; _Pred = std::equal_to<int>; _Alloc = std::allocator<std::pair<const int, int> >]’
  276 |       operator=(unordered_map&&) = default;
      |       ^~~~~~~~
/usr/include/c++/11/bits/unordered_map.h:276:17: note:   no known conversion for argument 1 from ‘int’ to ‘std::unordered_map<int, int>&&’
  276 |       operator=(unordered_map&&) = default;
      |                 ^~~~~~~~~~~~~~~
/usr/include/c++/11/bits/unordered_map.h:290:7: note: candidate: ‘std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(std::initializer_list<typename std::_Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::__is_nothrow_invocable<const _Hash&, const _Key&> > >::value, false, true> >::value_type>) [with _Key = int; _Tp = int; _Hash = std::hash<int>; _Pred = std::equal_to<int>; _Alloc = std::allocator<std::pair<const int, int> >; typename std::_Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::__is_nothrow_invocable<const _Hash&, const _Key&> > >::value, false, true> >::value_type = std::pair<const int, int>]’
  290 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/11/bits/unordered_map.h:290:46: note:   no known conversion for argument 1 from ‘int’ to ‘std::initializer_list<std::pair<const int, int> >’
  290 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
answer.code:224:32: error: no ‘operator++(int)’ declared for postfix ‘++’ [-fpermissive]
  224 |                         su[sum]++;
      |                         ~~~~~~~^~
answer.code:231:48: error: no match for ‘operator=’ (operand types are ‘pii’ {aka ‘std::pair<int, int>’} and ‘<brace-enclosed initializer list>’)
  231 |                         lst[nw] = {sum, su[sum]};
      |                                                ^
In file included from /usr/include/c++/11/bits/stl_algobase.h:64,
                 from /usr/include/c++/11/bits/char_traits.h:39,
                 from /usr/include/c++/11/ios:40,
                 from /usr/include/c++/11/istream:38,
                 from /usr/include/c++/11/sstream:38,
                 from /usr/include/c++/11/complex:45,
                 from /usr/include/c++/11/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54,
                 from answer.code:11:
/usr/include/c++/11/bits/stl_pair.h:418:9: note: candidate: ‘template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<_T1&, const _U1&>, std::is_assignable<_T2&, const _U2&> >::value, std::pair<_T1, _T2>&>::type std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U1 = _U1; _U2 = _U2; _T1 = int; _T2 = int]’
  418 |         operator=(const pair<_U1, _U2>& __p)
      |         ^~~~~~~~
/usr/include/c++/11/bits/stl_pair.h:418:9: note:   template argument deduction/substitution failed:
answer.code:231:48: note:   couldn’t deduce template parameter ‘_U1’
  231 |                         lst[nw] = {sum, su[sum]};
      |                                                ^
In file included from /usr/include/c++/11/bits/stl_algobase.h...