/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'bool isequal(double, double)':
foo.cpp:23:16: error: call of overloaded 'abs(double)' is ambiguous
      if(abs(a-b)<0.0000000001)
                ^
foo.cpp:23:16: note: candidates are:
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\cstdlib:72:0,
                 from foo.cpp:3:
c:\tdm-gcc-32\include\stdlib.h:374:37: note: int abs(int)
 _CRTIMP int __cdecl __MINGW_NOTHROW abs (int) __MINGW_ATTRIB_CONST;
                                     ^
In file included from foo.cpp:3:0:
c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\cstdlib:174:3: note: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^
c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\cstdlib:166:3: note: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^
foo.cpp: In function 'void bsrch(int)':
foo.cpp:32:18: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
         int mid=l+r>>1;
                  ^
foo.cpp:36:45: error: call of overloaded 'abs(double)' is ambiguous
         if(best>abs(Gold-S[index]*1.0/S[mid])){
                                             ^
foo.cpp:36:45: note: candidates are:
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\cstdlib:72:0,
                 from foo.cpp:3:
c:\tdm-gcc-32\include\stdlib.h:374:37: note: int abs(int)
 _CRTIMP int __cdecl __MINGW_NOTHROW abs (int) __MINGW_ATTRIB_CONST;
                                     ^
In file included from foo.cpp:3:0:
c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\cstdlib:174:3: note: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^
c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\cstdlib:166:3: note: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^
foo.cpp:37:45: error: call of overloaded 'abs(double)' is ambiguous
            best=abs(Gold-S[index]*1.0/S[mid]);
                                             ^
foo.cpp:37:45: note: candidates are:
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\cstdlib:72:0,
                 from foo.cpp:3:
c:\tdm-gcc-32\include\stdlib.h:374:37: note: int abs(int)
 _CRTIMP int __cdecl __MINGW_NOTHROW abs (int) __MINGW_ATTRIB_CONST;
                                     ^
In file included from foo.cpp:3:0:
c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\cstdlib:174:3: note: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^
c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\cstdlib:166:3: note: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^
foo.cpp:43:60: error: call of overloaded 'abs(double)' is ambiguous
     if(isequal(best,abs(S[Ans.first]*1.0/S[Ans.second]-Gold)))
                                                            ^
foo.cpp:43:60: note: candidates are:
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\cstdlib:72:0,
                 from foo.cpp:3:
c:\tdm-gcc-32\include\stdlib.h:374:37: note: int abs(int)
 _CRTIMP int __cdecl __MINGW_NOTHROW abs (int) __MINGW_ATTRIB_CONST;
                                     ^
In file included from foo.cpp:3:0:
c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\cstdlib:174:3: note: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^
c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\cstdlib:166:3: note: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^
foo.cpp:45:47: error: call of overloaded 'abs(double)' is ambiguous
     if(abs(S[Ans.first]*1.0/S[Ans.second]-Gold)>best)
                                               ^
foo.cpp:45:47: note: candidates are:
In file included from c:\tdm-gcc-32\lib\gcc\mingw32\4.8.1\include\c++\cstdlib:72:0,
                 from foo.cpp:3:
c:\tdm-gcc-32\include\stdlib.h:374:37: note: int abs(int)
 _CRTIMP int __cdecl __MINGW_NOTHROW abs (int) __MINGW_ATTRIB_CONST;

信息

递交者
类型
递交
题目
P1237 隐形的翅膀
语言
C++
递交时间
2014-11-04 16:35:17
评测时间
2014-11-04 16:35:18
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes