QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#472518 | #4925. Adjacent Pairs | MaMengQi | Compile Error | / | / | C++17 | 1.1kb | 2024-07-11 16:53:16 | 2024-07-11 16:53:17 |
Due to the privacy settings of the submitter, you are not allowed to view this code.
詳細信息
answer.code: In function ‘void solve()’: answer.code:26:9: error: ‘Input’ was not declared in this scope 26 | Input Output | ^~~~~ answer.code:28:30: error: ‘x’ was not declared in this scope 28 | if (i % 2 == 0) swap(x, y); | ^ answer.code:28:33: error: ‘y’ was not declared in this scope 28 | if (i % 2 == 0) swap(x, y); | ^ answer.code:29:27: error: ‘y’ was not declared in this scope 29 | ans = max(ans, c1[y] + c2[x] - mp[{x, y}]); | ^ answer.code:29:35: error: ‘x’ was not declared in this scope 29 | ans = max(ans, c1[y] + c2[x] - mp[{x, y}]); | ^ answer.code:29:42: error: no match for ‘operator[]’ (operand types are ‘std::map<std::pair<int, int>, int>’ and ‘<brace-enclosed initializer list>’) 29 | ans = max(ans, c1[y] + c2[x] - mp[{x, y}]); | ^ 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:1: /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::pair<int, int>; _Tp = int; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >; mapped_type = int; key_type = std::pair<int, int>]’ 504 | operator[](const key_type& __k) | ^~~~~~~~ /usr/include/c++/13/bits/stl_map.h:504:34: note: no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const std::map<std::pair<int, int>, int>::key_type&’ {aka ‘const std::pair<int, int>&’} 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::pair<int, int>; _Tp = int; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >; mapped_type = int; key_type = std::pair<int, int>]’ 524 | operator[](key_type&& __k) | ^~~~~~~~ /usr/include/c++/13/bits/stl_map.h:524:29: note: no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::map<std::pair<int, int>, int>::key_type&&’ {aka ‘std::pair<int, int>&&’} 524 | operator[](key_type&& __k) | ~~~~~~~~~~~^~~