QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#319142#8177. Sum is Integerucup-team598Compile Error//C++231.4kb2024-02-01 22:55:172024-02-01 22:55:19

详细

answer.code: In function ‘int main()’:
answer.code:60:43: error: conversion from ‘array<[...],2>’ to non-scalar type ‘array<[...],10>’ requested
   60 |                 array<long long , 10> c = cur ;
      |                                           ^~~
answer.code:62:26: error: no match for ‘operator[]’ (operand types are ‘std::map<std::array<long long int, 2>, int>’ and ‘std::array<long long int, 10>’)
   62 |                 ans += mp[c] ++ ;
      |                          ^
In file included from /usr/include/c++/13/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:152,
                 from answer.code:4:
/usr/include/c++/13/bits/stl_map.h:504:7: note: candidate: ‘std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::array<long long int, 2>; _Tp = int; _Compare = std::less<std::array<long long int, 2> >; _Alloc = std::allocator<std::pair<const std::array<long long int, 2>, int> >; mapped_type = int; key_type = std::array<long long int, 2>]’
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/13/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from ‘std::array<long long int, 10>’ to ‘const std::map<std::array<long long int, 2>, int>::key_type&’ {aka ‘const std::array<long long int, 2>&’}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/stl_map.h:524:7: note: candidate: ‘std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::array<long long int, 2>; _Tp = int; _Compare = std::less<std::array<long long int, 2> >; _Alloc = std::allocator<std::pair<const std::array<long long int, 2>, int> >; mapped_type = int; key_type = std::array<long long int, 2>]’
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/13/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from ‘std::array<long long int, 10>’ to ‘std::map<std::array<long long int, 2>, int>::key_type&&’ {aka ‘std::array<long long int, 2>&&’}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~