/ Vijos /

记录详情

Compile Error

/in/foo.cc:24:6: error: 'int time' redeclared as different kind of symbol
 int  time, n;
      ^~~~
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:2:
/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:34:12: error: assignment of function 'time_t time(time_t*)'
     time = 0;
            ^
/in/foo.cc:34:12: error: cannot convert 'int' to 'time_t(time_t*) throw () {aka long int(long int*) throw ()}' in assignment
/in/foo.cc:37:27: warning: pointer to a function used in arithmetic [-Wpointer-arith]
         if (time + num[i].t <= num[i].h)
                           ^
/in/foo.cc:37:39: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
         if (time + num[i].t <= num[i].h)
                                       ^
/in/foo.cc:39:28: warning: pointer to a function used in arithmetic [-Wpointer-arith]
             time += num[i].t;
                            ^
/in/foo.cc:39:28: error: assignment of function 'time_t time(time_t*)'
/in/foo.cc:39:28: 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:44:29: warning: pointer to a function used in arithmetic [-Wpointer-arith]
             time -= que.top();
                             ^
/in/foo.cc:44:29: error: assignment of function 'time_t time(time_t*)'
/in/foo.cc:44:29: 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:46:28: warning: pointer to a function used in arithmetic [-Wpointer-arith]
             time += num[i].t;
                            ^
/in/foo.cc:46:28: error: assignment of function 'time_t time(time_t*)'
/in/foo.cc:46:28: 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:50:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
     if (time <= num[n - 1].h) printf("%d", que.size());
                            ^
/in/foo.cc:50:54: warning: format '%d' expects argument of type 'int', but argument 2 has type 'std::priority_queue<int>::size_type {aka long unsigned int}' [-Wformat=]
     if (time <= num[n - 1].h) printf("%d", que.size());
                                                      ^
/in/foo.cc:51:35: warning: format '%d' expects argument of type 'int', but argument 2 has type 'std::priority_queue<int>::size_type {aka long unsigned int}' [-Wformat=]
     else printf("%d", que.size()-1);
                                   ^

信息

递交者
类型
递交
题目
P1513 紧急救援
语言
C++
递交时间
2020-10-19 15:37:16
评测时间
2020-10-19 15:37:16
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes