F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_39286476_26558.cpp:8:8: error: 'double time' redeclared as different kind of entity
    8 | double time;
      |        ^~~~
In file included from gcc-13.1.0/x86_64-w64-mingw32/include/pthread.h:69,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/x86_64-w64-mingw32/bits/gthr-default.h:35,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/x86_64-w64-mingw32/bits/gthr.h:148,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/ext/atomicity.h:35,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/ios_base.h:39,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/ios:44,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/ostream:40,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/iostream:41,
                 from 0_0_39286476_26558.cpp:1:
gcc-13.1.0/x86_64-w64-mingw32/include/time.h:256:34: note: previous declaration 'time_t time(time_t*)'
  256 | static __inline time_t __CRTDECL time(time_t *_Time) { return _time64(_Time); }
      |                                  ^~~~
0_0_39286476_26558.cpp: In function 'int main()':
0_0_39286476_26558.cpp:30:46: error: assignment of function 'time_t time(time_t*)'
   30 |                                         time = c*1.0/vt1 + (len-c)*1.0/vt2;
      |                                         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0_0_39286476_26558.cpp:32:46: error: assignment of function 'time_t time(time_t*)'
   32 |                                         time = len*1.0/vt1;
      |                                         ~~~~~^~~~~~~~~~~~~
0_0_39286476_26558.cpp:34:37: error: invalid operands of types 'time_t(time_t*)' {aka 'long long int(long long int*)'} and 'double' to binary 'operator+'
   34 |                                 time+=dp[j];
      |                                 ~~~~^~~~~~~
0_0_39286476_26558.cpp:34:37: note:   in evaluation of 'operator+=(time_t(time_t*) {aka long long int(long long int*)}, double)'
0_0_39286476_26558.cpp:35:45: error: assignment of read-only location 'time'
   35 |                                 if(j>0) time+=t;
      |                                         ~~~~^~~
0_0_39286476_26558.cpp:36:44: error: no matching function for call to 'min(double&, time_t (&)(time_t*))'
   36 |                                 dp[i] = min(dp[i],time);
      |                                         ~~~^~~~~~~~~~~~
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/string:51,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/locale_classes.h:40,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/ios_base.h:41:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
0_0_39286476_26558.cpp:36:44: note:   deduced conflicting types for parameter 'const _Tp' ('double' and 'time_t(time_t*)' {aka 'long long int(long long int*)'})
   36 |                                 dp[i] = min(dp[i],time);
      |                                         ~~~^~~~~~~~~~~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algobase.h:281:5: note:   template argument deduction/substitution failed:
0_0_39286476_26558.cpp:36:44: note:   deduced conflicting types for parameter 'const _Tp' ('double' and 'time_t(time_t*)' {aka 'long long int(long long int*)'})
   36 |                                 dp[i] = min(dp[i],time);
      |                                         ~~~^~~~~~~~~~~~
0_0_39286476_26558.cpp:12:8: note: candidate: 'double min(double, double)'
   12 | double min(double a,double b){
      |        ^~~
0_0_39286476_26558.cpp:12:28: note:   no known conversion for argument 2 from 'time_t(time_t*)' {aka 'long long int(long long int*)'} to 'double'
   12 | double min(double a,double b){
      |                     ~~~~~~~^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-17 01:19:46, Gzip enabled