/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'void tree_dp(int)':
foo.cpp:37:62: error: no matching function for call to 'min(long long int, int&)'
         mins=min(dp[v[now][i]][1][1]-dp[v[now][i]][1][0],mins);
                                                              ^
foo.cpp:37:62: note: candidates are:
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\char_traits.h:39:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
                 from foo.cpp:1:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:193:5: note:   template argument deduction/substitution failed:
foo.cpp:37:62: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
         mins=min(dp[v[now][i]][1][1]-dp[v[now][i]][1][0],mins);
                                                              ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\char_traits.h:39:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
                 from foo.cpp:1:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:239: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:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:239:5: note:   template argument deduction/substitution failed:
foo.cpp:37:62: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
         mins=min(dp[v[now][i]][1][1]-dp[v[now][i]][1][0],mins);
                                                              ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62:0,
                 from foo.cpp:6:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:4244:5: note: template<class _Tp> _Tp std::min(std::initializer_list<_Tp>)
     min(initializer_list<_Tp> __l)
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:4244:5: note:   template argument deduction/substitution failed:
foo.cpp:37:62: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
         mins=min(dp[v[now][i]][1][1]-dp[v[now][i]][1][0],mins);
                                                              ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62:0,
                 from foo.cpp:6:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:4249:5: note: template<class _Tp, class _Compare> _Tp std::min(std::initializer_list<_Tp>, _Compare)
     min(initializer_list<_Tp> __l, _Compare __comp)
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:4249:5: note:   template argument deduction/substitution failed:
foo.cpp:37:62: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
         mins=min(dp[v[now][i]][1][1]-dp[v[now][i]][1][0],mins);
                                                              ^
foo.cpp: In function 'int main()':
foo.cpp:48:18: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
     scanf("%d",&n);
                  ^
foo.cpp:51:23: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
         scanf("%d",&tp);
                       ^
foo.cpp:52:33: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
         scanf("%d%d",cost+tp,&vi);
                                 ^
foo.cpp:52:33: warning: format '%d' e

信息

递交者
类型
递交
题目
P1144 小胖守皇宫
语言
C++
递交时间
2016-11-15 11:09:54
评测时间
2016-11-15 11:09:55
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes