/ TYWZ /

记录详情

Compile Error

/in/foo.cc:6:7: error: 'int time' redeclared as different kind of symbol
 int n,time=0,sum=0,dp[101];
       ^~~~
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 /in/foo.cc:1:
/usr/include/time.h:192:15: note: previous declaration 'time_t time(time_t*)'
 extern time_t time (time_t *__timer) __THROW;
               ^~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:26:16: error: invalid operands of types 'int' and 'time_t(time_t*) throw () {aka long int(long int*) throw ()}' to binary 'operator-'
       if(e[i].a-time>=e[i].t)
          ~~~~~~^~~~~
/in/foo.cc:28:12: warning: pointer to a function used in arithmetic [-Wpointer-arith]
        time+=e[i].t;
        ~~~~^~~~~~~~
/in/foo.cc:28:19: error: assignment of read-only location 'time'
        time+=e[i].t;
                   ^
/in/foo.cc:28:19: 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

信息

递交者
类型
递交
题目
17.10.5 Prob I - Showtime
比赛
2017.10.5 TYWZ NOIp提高组模拟练习
语言
C++
递交时间
2017-10-05 11:41:53
评测时间
2017-10-05 11:41:53
评测机
分数
0
总耗时
414ms
峰值内存
36.914 MiB