记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:38:8: error: expected unqualified-id before '[' token
   auto [x, y] = Q.front(); Q.pop();
        ^
/in/foo.cc:41:12: error: 'x' was not declared in this scope
    int u = x + dx[i], v = y + dy[i];
            ^
/in/foo.cc:42:26: error: 'v' was not declared in this scope
    if (u < 1 || u > n || v < 1 || v > m) continue;
                          ^
/in/foo.cc:43:23: error: 'y' was not declared in this scope
    int K = min(res[x][y] - 2 + g[u][v], M);
                       ^
/in/foo.cc:43:37: error: 'v' was not declared in this scope
    int K = min(res[x][y] - 2 + g[u][v], M);
                                     ^
/in/foo.cc:47:31: error: no matching function for call to 'std::queue<std::pair<int, int> >::push(<brace-enclosed initializer list>)'
     if (K >= 2) Q.push({ u,v });
                               ^
In file included from /usr/include/c++/6/queue:64:0,
                 from /in/foo.cc:3:
/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<int, int>; _Sequence = std::deque<std::pair<int, int>, std::allocator<std::pair<int, int> > >; std::queue<_Tp, _Sequence>::value_type = std::pair<int, 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<int, 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<int, int>; _Sequence = std::deque<std::pair<int, int>, std::allocator<std::pair<int, int> > >; std::queue<_Tp, _Sequence>::value_type = std::pair<int, 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<int, int> >::value_type&& {aka std::pair<int, int>&&}'

信息

递交者
类型
递交
题目
P1517 歌仙之章
语言
C++
递交时间
2023-10-13 16:38:47
评测时间
2023-10-13 16:45:08
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes