/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int recu(float, int)':
foo.cpp:9:27: error: reference to 'min' is ambiguous
 if (now >= L) { if (Sst < min) min = Sst; } else { for (int i = S; i <= T; i++) { float temp = now + i; bool cai = false; for (int j = 1; j <= M; j++) { if (temp == st[j]) { cai = true; break; } } if (cai==true) recu(now + i, Sst + 1); else recu(now + i, Sst); } } return 0; }
                           ^
foo.cpp:3:5: note: candidates are: int min
 int min;
     ^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/char_traits.h:39:0,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ios:40,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ostream:38,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/iostream:39,
                 from foo.cpp:1:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algobase.h:240:5: note:                 template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algobase.h:194:5: note:                 template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
foo.cpp:9:32: error: reference to 'min' is ambiguous
 if (now >= L) { if (Sst < min) min = Sst; } else { for (int i = S; i <= T; i++) { float temp = now + i; bool cai = false; for (int j = 1; j <= M; j++) { if (temp == st[j]) { cai = true; break; } } if (cai==true) recu(now + i, Sst + 1); else recu(now + i, Sst); } } return 0; }
                                ^
foo.cpp:3:5: note: candidates are: int min
 int min;
     ^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/char_traits.h:39:0,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ios:40,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ostream:38,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/iostream:39,
                 from foo.cpp:1:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algobase.h:240:5: note:                 template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algobase.h:194:5: note:                 template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
foo.cpp: In function 'int main()':
foo.cpp:12:97: error: reference to 'min' is ambiguous
 cin >> L; cin >> S >> T >> M; for (int i = 1; i <= M; i++) { cin >> st[i]; } recu(0,0); cout << min<<endl;
                                                                                                 ^
foo.cpp:3:5: note: candidates are: int min
 int min;
     ^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/char_traits.h:39:0,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ios:40,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ostream:38,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/iostream:39,
                 from foo.cpp:1:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algobase.h:240:5: note:                 template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/stl_algobase.h:194:5: note:                 template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
foo.cpp:12:106: error: expected '}' at end of input
 cin >> L; cin >> S >> T >> M; for (int i = 1; i <= M; i++) { cin >> st[i]; } recu(0,0); cout << min<<endl;
                                                                                                          ^

信息

递交者
类型
递交
题目
P1002 过河
语言
C++
递交时间
2015-08-26 13:16:41
评测时间
2015-08-26 13:16:42
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes