记录详情

Compile Error

/in/foo.cc: In constructor 'Dist::Dist(int, int)':
/in/foo.cc:14:9: warning: 'Dist::dist' will be initialized after [-Wreorder]
  int x, dist;
         ^~~~
/in/foo.cc:14:6: warning:   'int Dist::x' [-Wreorder]
  int x, dist;
      ^
/in/foo.cc:15:2: warning:   when initialized here [-Wreorder]
  Dist(int x = 0, int dist = INF) : dist(dist), x(x) {}
  ^~~~
/in/foo.cc: In function 'int dijkstra()':
/in/foo.cc:47:14: error: reference to 'end' is ambiguous
  return dist[end];
              ^~~
/in/foo.cc:21:42: note: candidates are: int end
 int head[MAXN], dist[MAXN], n, m, start, end, num;
                                          ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:95:0,
                 from /in/foo.cc:1:
/usr/include/c++/6/valarray:1226:5: note:                 template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)
     end(const valarray<_Tp>& __va)
     ^~~
/usr/include/c++/6/valarray:1216:5: note:                 template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)
     end(valarray<_Tp>& __va)
     ^~~
In file included from /usr/include/c++/6/string:51:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/range_access.h:97:5: note:                 template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])
     end(_Tp (&__arr)[_Nm])
     ^~~
/usr/include/c++/6/bits/range_access.h:78:5: note:                 template<class _Container> decltype (__cont.end()) std::end(const _Container&)
     end(const _Container& __cont) -> decltype(__cont.end())
     ^~~
/usr/include/c++/6/bits/range_access.h:68:5: note:                 template<class _Container> decltype (__cont.end()) std::end(_Container&)
     end(_Container& __cont) -> decltype(__cont.end())
     ^~~
In file included from /usr/include/c++/6/bits/range_access.h:36:0,
                 from /usr/include/c++/6/string:51,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/usr/include/c++/6/initializer_list:99:5: note:                 template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)
     end(initializer_list<_Tp> __ils) noexcept
     ^~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:52:37: error: reference to 'end' is ambiguous
  scanf("%d%d%d%d", &n, &m, &start, &end);
                                     ^~~
/in/foo.cc:21:42: note: candidates are: int end
 int head[MAXN], dist[MAXN], n, m, start, end, num;
                                          ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:95:0,
                 from /in/foo.cc:1:
/usr/include/c++/6/valarray:1226:5: note:                 template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)
     end(const valarray<_Tp>& __va)
     ^~~
/usr/include/c++/6/valarray:1216:5: note:                 template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)
     end(valarray<_Tp>& __va)
     ^~~
In file included from /usr/include/c++/6/string:51:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/range_access.h:97:5: note:                 template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])
     end(_Tp (&__arr)[_Nm])
     ^~~
/usr/include/c++/6/bits/range_access.h:78:5: note:                 template<class _Container> decltype (__cont.end()) std::end(const _Container&)
     end(const _Container& __cont) -> decltype(__cont.end())
     ^~~
/usr/include/c++/6/bits/range_access.h:68:5: note:                 template<class _Container> decltype (__cont.end()) std::end(_Container&)
     end(_Container& __cont) -> decltype(__cont.end())
     ^~~
In file included from /usr/include/c++/6/bits/range_access.h:36:0,
                 from /usr/include/c++/6/string:51,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/usr/include/c++/6/initializer_list:99:5: note:                 template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)
     end(initializer_list<_Tp> __ils) noexcept
     ^~~

信息

递交者
类型
递交
题目
热浪(heatwv)
语言
C++
递交时间
2019-10-12 15:28:07
评测时间
2019-10-12 15:28:07
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes