/ Vijos /

记录详情

Compile Error

/in/foo.cc: In member function 'int Graph::get_label(const string&)':
/in/foo.cc:28:18: error: expected unqualified-id before '[' token
             auto [current_player, label] = q.front();
                  ^
/in/foo.cc:31:17: error: 'current_player' was not declared in this scope
             if (current_player == "Xiaodao") {
                 ^~~~~~~~~~~~~~
/in/foo.cc:32:24: error: 'label' was not declared in this scope
                 return label;
                        ^~~~~
/in/foo.cc:35:30: error: 'current_player' was not declared in this scope
             if (visited.find(current_player) == visited.end()) {
                              ^~~~~~~~~~~~~~
/in/foo.cc:39:39: error: 'label' was not declared in this scope
                     q.push({teammate, label + 1});
                                       ^~~~~
/in/foo.cc:39:49: error: no matching function for call to 'std::queue<std::pair<std::__cxx11::basic_string<char>, int> >::push(<brace-enclosed initializer list>)'
                     q.push({teammate, label + 1});
                                                 ^
In file included from /usr/include/c++/6/queue:64:0,
                 from /in/foo.cc:4:
/usr/include/c++/6/bits/stl_queue.h:242:7: note: candidate: void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<std::__cxx11::basic_string<char>, int>; _Sequence = std::deque<std::pair<std::__cxx11::basic_string<char>, int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, int> > >; std::queue<_Tp, _Sequence>::value_type = std::pair<std::__cxx11::basic_string<char>, int>]
       push(const value_type& __x)
       ^~~~
/usr/include/c++/6/bits/stl_queue.h:242:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const std::pair<std::__cxx11::basic_string<char>, int>&}'
/usr/include/c++/6/bits/stl_queue.h:247:7: note: candidate: void std::queue<_Tp, _Sequence>::push(std::queue<_Tp, _Sequence>::value_type&&) [with _Tp = std::pair<std::__cxx11::basic_string<char>, int>; _Sequence = std::deque<std::pair<std::__cxx11::basic_string<char>, int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, int> > >; std::queue<_Tp, _Sequence>::value_type = std::pair<std::__cxx11::basic_string<char>, int>]
       push(value_type&& __x)
       ^~~~
/usr/include/c++/6/bits/stl_queue.h:247:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::queue<std::pair<std::__cxx11::basic_string<char>, int> >::value_type&& {aka std::pair<std::__cxx11::basic_string<char>, int>&&}'
/in/foo.cc: In function 'int main()':
/in/foo.cc:66:22: error: expected unqualified-id before '[' token
     for (const auto& [player, _] : graph.teammates) {
                      ^
/in/foo.cc:66:22: error: expected ';' before '[' token
/in/foo.cc:66:23: error: 'player' was not declared in this scope
     for (const auto& [player, _] : graph.teammates) {
                       ^~~~~~
/in/foo.cc:66:31: error: '_' was not declared in this scope
     for (const auto& [player, _] : graph.teammates) {
                               ^
/in/foo.cc: In lambda function:
/in/foo.cc:66:34: error: expected '{' before ':' token
     for (const auto& [player, _] : graph.teammates) {
                                  ^
/in/foo.cc: In function 'int main()':
/in/foo.cc:66:34: error: expected ';' before ':' token
/in/foo.cc:66:34: error: expected primary-expression before ':' token
/in/foo.cc:66:34: error: expected ')' before ':' token
/in/foo.cc:66:34: error: expected primary-expression before ':' token
/in/foo.cc:72:22: error: expected unqualified-id before '[' token
     for (const auto& [player, _] : player_labels) {
                      ^
/in/foo.cc:72:22: error: expected ';' before '[' token
/in/foo.cc:72:23: error: 'player' was not declared in this scope
     for (const auto& [player, _] : player_labels) {
                       ^~~~~~
/in/foo.cc:72:31: error: '_' was not declared in this scope
     for (const auto& [player, _] : player_labels) {
                               ^
/in/foo.cc: In lambda function:
/in/foo.cc:72:34: error: expected '{' before ':' token
     for (const auto& [player, _] : player_labels) {
                                  ^
/in/foo.cc: In function 'int main()':
/in/foo.cc:72:34: error: expected ';' before ':' token
/in/foo.cc:72:34: error: expected primary-expression before ':' token
/in/foo.cc:72:34: error: expected ')' before ':' token
/in/foo.cc:72:34: error: expected primary-expression before ':' token

信息

递交者
类型
递交
题目
P1876 小岛的标号
语言
C++
递交时间
2024-01-13 11:29:11
评测时间
2024-01-13 11:29:11
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes