Submission #00030
ソースコード
ステータス
コンパイルメッセージ
./Main.cpp:16:15: error: ‘Edge’ was not declared in this scope
vector<vector<Edge>> G;
^~~~
./Main.cpp:16:15: error: template argument 1 is invalid
./Main.cpp:16:15: error: template argument 2 is invalid
./Main.cpp:16:19: error: template argument 1 is invalid
vector<vector<Edge>> G;
^~
./Main.cpp:16:19: error: template argument 2 is invalid
./Main.cpp: In function ‘int main()’:
./Main.cpp:39:7: error: request for member ‘resize’ in ‘G’, which is of non-class type ‘int’
G.resize(N);
^~~~~~
./Main.cpp:44:12: error: invalid types ‘int[int]’ for array subscript
G[u].pb(v, c);
^
./Main.cpp:48:20: warning: overflow in conversion from ‘ll’ {aka ‘long long int’} to ‘std::vector<int>::value_type’ {aka ‘int’} changes value from ‘100000000000001’ to ‘276447233’ [-Woverflow]
dist.assign(N, inf);
^~~
./Main.cpp:56:42: error: invalid types ‘int[int]’ for array subscript
for (auto e : G[j]) { // 接続辺の先の頂点を更新する
^
./Main.cpp:64:33: error: no match for ‘operator=’ (operand types are ‘std::vector<long long int>’ and ‘std::vector<int>’)
dist2 = dist;
^~~~
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/vector:69,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/functional:62,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:71,
from ./Main.cpp:3:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/vector.tcc:186:5: note: candidate: ‘std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]’
vector<_Tp, _Alloc>::
^~~~~~~~~~~~~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/vector.tcc:186:5: note: no known conversion for argument 1 from ‘std::vector<int>’ to ‘const std::vector<long long int>&’
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/vector:64,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/functional:62,
from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:71,
from ./Main.cpp:3:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_vector.h:596:7: note: candidate: ‘std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]’
operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
^~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_vector.h:596:7: note: no known conversion for argument 1 from ‘std::vector<int>’ to ‘std::vector<long long int>&&’
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_vector.h:617:7: note: candidate: ‘std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = long long int; _Alloc = std::allocator<long long int>]’
operator=(initializer_list<value_type> __l)
^~~~~~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/stl_vector.h:617:7: note: no known conversion for argument 1 from ‘std::vector<int>’ to ‘std::initializer_list<long long int>’
セット
テストケース