记录详情

Compile Error

foo.cc:4:16: error: 'int time [21]' redeclared as different kind of symbol
 int a[N],time[N],ans=0x7f7f7f7f;
                ^
In file included from /usr/include/pthread.h:24:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/gthr.h:148,
                 from /usr/include/c++/7/ext/atomicity.h:35,
                 from /usr/include/c++/7/bits/ios_base.h:39,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from foo.cc:1:
/usr/include/time.h:75:15: note: previous declaration 'time_t time(time_t*)'
 extern time_t time (time_t *__timer) __THROW;
               ^~~~
foo.cc: In function 'void sb(int)':
foo.cc:13:15: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    if(y<time[i])
               ^
foo.cc:13:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
foo.cc:15:13: warning: pointer to a function used in arithmetic [-Wpointer-arith]
     y=time[i];
             ^
foo.cc:15:13: error: invalid conversion from 'time_t (*)(time_t*) throw () {aka long int (*)(long int*) throw ()}' to 'int' [-fpermissive]
     y=time[i];
       ~~~~~~^
foo.cc:26:9: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   time[i]+=a[x];
         ^
foo.cc:26:10: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   time[i]+=a[x];
   ~~~~~~~^~~~~~
foo.cc:26:15: error: assignment of read-only location '*(time + ((sizetype)i))'
   time[i]+=a[x];
               ^
foo.cc:26:15: error: cannot convert 'time_t (*)(time_t*) throw () {aka long int (*)(long int*) throw ()}' to 'time_t(time_t*) throw () {aka long int(long int*) throw ()}' in assignment
foo.cc:28:9: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   time[i]-=a[x];
         ^
foo.cc:28:10: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   time[i]-=a[x];
   ~~~~~~~^~~~~~
foo.cc:28:15: error: assignment of read-only location '*(time + ((sizetype)i))'
   time[i]-=a[x];
               ^
foo.cc:28:15: error: cannot convert 'time_t (*)(time_t*) throw () {aka long int (*)(long int*) throw ()}' to 'time_t(time_t*) throw () {aka long int(long int*) throw ()}' in assignment
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
最佳调度问题
题目数据
下载
语言
C++
递交时间
2021-10-17 16:21:47
评测时间
2021-10-17 16:21:47
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes