/ Vijos /

记录详情

Compile Error

/in/foo.cc:38:22: error: 'int time' redeclared as different kind of symbol
 int n,m,q,u,v,t,temp,time,from;
                      ^~~~
In file included from /usr/include/pthread.h:24:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/gthr.h:148,
                 from /usr/include/c++/6/ext/atomicity.h:35,
                 from /usr/include/c++/6/bits/ios_base.h:39,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/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 'void deal()':
/in/foo.cc:74:9: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   temp+=time;
         ^~~~
/in/foo.cc:74:9: error: invalid conversion from 'time_t (*)(time_t*) throw () {aka long int (*)(long int*) throw ()}' to 'int' [-fpermissive]
/in/foo.cc:75:9: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   time+=q;
         ^
/in/foo.cc:75:9: error: assignment of function 'time_t time(time_t*)'
/in/foo.cc:75:9: 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
/in/foo.cc:82:17: error: invalid operands of types 'int' and 'time_t(time_t*) throw () {aka long int(long int*) throw ()}' to binary 'operator-'
   q2.push_(first-time);q3.push_(second-time);
            ~~~~~^~~~~
/in/foo.cc:82:39: error: invalid operands of types 'int' and 'time_t(time_t*) throw () {aka long int(long int*) throw ()}' to binary 'operator-'
   q2.push_(first-time);q3.push_(second-time);
                                 ~~~~~~^~~~~
/in/foo.cc: In function 'void Print()':
/in/foo.cc:90:9: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   temp+=time;
         ^~~~
/in/foo.cc:90:9: error: invalid conversion from 'time_t (*)(time_t*) throw () {aka long int (*)(long int*) throw ()}' to 'int' [-fpermissive]

信息

递交者
类型
递交
题目
P2007 蚯蚓
语言
C++
递交时间
2017-05-28 21:56:28
评测时间
2017-05-28 21:56:28
评测机
分数
0
总耗时
349ms
峰值内存
35.73 MiB