F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_37994170_16140.cpp: In function 'int main()':
0_0_37994170_16140.cpp:39:9: error: expected unqualified-id before '[' token
    auto [aj, j] = q.top();
         ^
0_0_37994170_16140.cpp:40:8: error: 'aj' was not declared in this scope
    if (aj == 1)
        ^
0_0_37994170_16140.cpp:43:9: error: expected unqualified-id before '[' token
    auto [ai, i] = q.top();
         ^
0_0_37994170_16140.cpp:45:8: error: 'ai' was not declared in this scope
    if (ai == aj) {
        ^
0_0_37994170_16140.cpp:45:14: error: 'aj' was not declared in this scope
    if (ai == aj) {
              ^
0_0_37994170_16140.cpp:46:21: error: 'i' was not declared in this scope
     q.push({ai - 1, i});
                     ^
0_0_37994170_16140.cpp:46:23: error: no matching function for call to 'std::priority_queue<std::pair<int, int> >::push(<brace-enclosed initializer list>)'
     q.push({ai - 1, i});
                       ^
0_0_37994170_16140.cpp:46:23: note: candidates are:
In file included from GCC4.9.2/x86_64-w64-mingw32/include/c++/queue:64:0,
                 from GCC4.9.2/x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32/bits/stdc++.h:85,
                 from 0_0_37994170_16140.cpp:4:
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_queue.h:499:7: note: void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = std::pair<int, int>; _Sequence = std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >; _Compare = std::less<std::pair<int, int> >; std::priority_queue<_Tp, _Sequence, _Compare>::value_type = std::pair<int, int>]
       push(const value_type& __x)
       ^
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_queue.h:499:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const std::pair<int, int>&}'
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_queue.h:507:7: note: void std::priority_queue<_Tp, _Sequence, _Compare>::push(std::priority_queue<_Tp, _Sequence, _Compare>::value_type&&) [with _Tp = std::pair<int, int>; _Sequence = std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >; _Compare = std::less<std::pair<int, int> >; std::priority_queue<_Tp, _Sequence, _Compare>::value_type = std::pair<int, int>]
       push(value_type&& __x)
       ^
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_queue.h:507:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::priority_queue<std::pair<int, int> >::value_type&& {aka std::pair<int, int>&&}'
0_0_37994170_16140.cpp:47:18: error: 'j' was not declared in this scope
     dsu.merge(i, j);
                  ^
0_0_37994170_16140.cpp:49:17: error: 'i' was not declared in this scope
     q.push({ai, i});
                 ^
0_0_37994170_16140.cpp:49:19: error: no matching function for call to 'std::priority_queue<std::pair<int, int> >::push(<brace-enclosed initializer list>)'
     q.push({ai, i});
                   ^
0_0_37994170_16140.cpp:49:19: note: candidates are:
In file included from GCC4.9.2/x86_64-w64-mingw32/include/c++/queue:64:0,
                 from GCC4.9.2/x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32/bits/stdc++.h:85,
                 from 0_0_37994170_16140.cpp:4:
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_queue.h:499:7: note: void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = std::pair<int, int>; _Sequence = std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >; _Compare = std::less<std::pair<int, int> >; std::priority_queue<_Tp, _Sequence, _Compare>::value_type = std::pair<int, int>]
       push(const value_type& __x)
       ^
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_queue.h:499:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const std::pair<int, int>&}'
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_queue.h:507:7: note: void std::priority_queue<_Tp, _Sequence, _Compare>::push(std::priority_queue<_Tp, _Sequence, _Compare>::value_type&&) [with _Tp = std::pair<int, int>; _Sequence = std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >; _Compare = std::less<std::pair<int, int> >; std::priority_queue<_Tp, _Sequence, _Compare>::value_type = std::pair<int, int>]
       push(value_type&& __x)
       ^
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_queue.h:507:7: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::priority_queue<std::pair<int, int> >::value_type&& {aka std::pair<int, int>&&}'


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-26 17:15:23, Gzip enabled