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_39241412_22363.cpp: In function 'void dijkstra()':
0_0_39241412_22363.cpp:28:22: error: cannot convert 'node' to 'int' in initialization
   28 |         for(int p:e[x]){
      |                      ^
0_0_39241412_22363.cpp:29:20: error: request for member 'v' in 'p', which is of non-class type 'int'
   29 |             if(d[p.v]>d[x]+p.w){
      |                    ^
0_0_39241412_22363.cpp:29:30: error: request for member 'w' in 'p', which is of non-class type 'int'
   29 |             if(d[p.v]>d[x]+p.w){
      |                              ^
0_0_39241412_22363.cpp:30:21: error: request for member 'v' in 'p', which is of non-class type 'int'
   30 |                 d[p.v]=d[x]+p.w;
      |                     ^
0_0_39241412_22363.cpp:30:31: error: request for member 'w' in 'p', which is of non-class type 'int'
   30 |                 d[p.v]=d[x]+p.w;
      |                               ^
0_0_39241412_22363.cpp:31:27: error: request for member 'v' in 'p', which is of non-class type 'int'
   31 |                 q.push({p.v,d[p.v]});
      |                           ^
0_0_39241412_22363.cpp:31:33: error: request for member 'v' in 'p', which is of non-class type 'int'
   31 |                 q.push({p.v,d[p.v]});
      |                                 ^
0_0_39241412_22363.cpp:31:23: error: no matching function for call to 'std::priority_queue<node>::push(<brace-enclosed initializer list>)'
   31 |                 q.push({p.v,d[p.v]});
      |                 ~~~~~~^~~~~~~~~~~~~~
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/queue:66,
                 from .\stdc++.h:157:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_queue.h:738:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = node; _Sequence = std::vector<node>; _Compare = std::less<node>; value_type = node]'
  738 |       push(const value_type& __x)
      |       ^~~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_queue.h:738:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::priority_queue<node>::value_type&' {aka 'const node&'}
  738 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_queue.h:746:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(value_type&&) [with _Tp = node; _Sequence = std::vector<node>; _Compare = std::less<node>; value_type = node]'
  746 |       push(value_type&& __x)
      |       ^~~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_queue.h:746:25: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::priority_queue<node>::value_type&&' {aka 'node&&'}
  746 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~


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-09-28 11:22:35, Gzip enabled