/ Vijos /

记录详情

Compile Error

/in/foo.cc:10:9: error: 'int time' redeclared as different kind of symbol
 int n,m,time;
         ^~~~
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:17:28: warning: format '%d' expects argument of type 'int*', but argument 4 has type 'time_t (*)(time_t*) throw () {aka long int (*)(long int*) throw ()}' [-Wformat=]
  scanf("%d%d%d",&m,&n,&time);
                       ~~~~~^
/in/foo.cc:30:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
  if(2*pea[0].x+1>time){
                  ^~~~
/in/foo.cc:34:11: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  time=time-pea[0].x;
       ~~~~^~~~~~~~~
/in/foo.cc:34:19: error: assignment of function 'time_t time(time_t*)'
  time=time-pea[0].x;
                   ^
/in/foo.cc:34: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
/in/foo.cc:36:6: warning: ISO C++ forbids decrementing a pointer of type 'time_t (*)(time_t*) throw () {aka long int (*)(long int*) throw ()}' [-Wpointer-arith]
  time--;
      ^~
/in/foo.cc:36:6: error: lvalue required as decrement operand
/in/foo.cc:40:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   if(o<=time){
         ^~~~
/in/foo.cc:42:13: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    time=time-abs(pea[i].x-pea[i+1].x)-abs(pea[i].y-pea[i+1].y)-1;
         ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/in/foo.cc:42:38: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    time=time-abs(pea[i].x-pea[i+1].x)-abs(pea[i].y-pea[i+1].y)-1;
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/in/foo.cc:42:63: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    time=time-abs(pea[i].x-pea[i+1].x)-abs(pea[i].y-pea[i+1].y)-1;
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/in/foo.cc:42:64: error: assignment of function 'time_t time(time_t*)'
    time=time-abs(pea[i].x-pea[i+1].x)-abs(pea[i].y-pea[i+1].y)-1;
                                                                ^
/in/foo.cc:42:64: 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

信息

递交者
类型
递交
题目
P1120 花生采摘
语言
C++
递交时间
2017-10-06 17:03:23
评测时间
2017-10-06 17:03:23
评测机
分数
0
总耗时
370ms
峰值内存
36.473 MiB