/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'void d(int)':
foo.cpp:103:23: error: no matching function for call to 'max(long long int&, int&)'
        a[0]=max(a[0],j);
                       ^
foo.cpp:103:23: note: candidates are:
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:61:0,
                 from foo.cpp:3:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:216:5: note:   template argument deduction/substitution failed:
foo.cpp:103:23: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
        a[0]=max(a[0],j);
                       ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:61:0,
                 from foo.cpp:3:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:260:5: note:   template argument deduction/substitution failed:
foo.cpp:103:23: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
        a[0]=max(a[0],j);
                       ^
foo.cpp: In function 'int main()':
foo.cpp:135:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 for (int i=1;i<=strlen(s+1);i++){
                                           ^
foo.cpp:150:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 for (;i<=strlen(s+1)%9;i++)
                                      ^
foo.cpp:155:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 for (;i<=strlen(s+1);i++){
                                    ^
foo.cpp:167:59: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
                 if (k[0]==1 && k[1]<=3) printf("%d\n",k[1]);
                                                           ^
foo.cpp:205:27: error: no matching function for call to 'max(long long int&, int&)'
            a[0]=max(a[0],j);     
                           ^
foo.cpp:205:27: note: candidates are:
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:61:0,
                 from foo.cpp:3:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:216:5: note:   template argument deduction/substitution failed:
foo.cpp:205:27: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
            a[0]=max(a[0],j);     
                           ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:61:0,
                 from foo.cpp:3:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:260:5: note:   template argument deduction/substitution failed:
foo.cpp:205:27: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
            a[0]=max(a[0],j);     
                           ^

信息

递交者
类型
递交
题目
P1472 教主的集合序列
语言
C++
递交时间
2016-06-14 13:28:06
评测时间
2016-06-14 13:28:06
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes