/ Vijos /

记录详情

Compile Error

/in/foo.cc:11:9: error: 'clock_t stime' redeclared as different kind of symbol
 clock_t stime;
         ^~~~~
In file included from /usr/include/c++/6/ctime:42:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:49,
                 from /in/foo.cc:1:
/usr/include/time.h:304:12: note: previous declaration 'int stime(const time_t*)'
 extern int stime (const time_t *__when) __THROW;
            ^~~~~
/in/foo.cc: In function 'void opt3()':
/in/foo.cc:13:28: error: invalid operands of types 'clock_t {aka long int}' and 'int(const time_t*) throw () {aka int(const long int*) throw ()}' to binary 'operator-'
 #define gettime() (clock() - stime)
                    ~~~~~~~~^~~
/in/foo.cc:95:13: note: in expansion of macro 'gettime'
         if (gettime() + 2 * avg2 > Limit)
             ^~~~~~~
/in/foo.cc: In function 'void opt2()':
/in/foo.cc:13:28: error: invalid operands of types 'clock_t {aka long int}' and 'int(const time_t*) throw () {aka int(const long int*) throw ()}' to binary 'operator-'
 #define gettime() (clock() - stime)
                    ~~~~~~~~^~~
/in/foo.cc:176:13: note: in expansion of macro 'gettime'
         if (gettime() + 2 * avg2 > Limit)
             ^~~~~~~
/in/foo.cc: In function 'void approach()':
/in/foo.cc:13:28: error: invalid operands of types 'clock_t {aka long int}' and 'int(const time_t*) throw () {aka int(const long int*) throw ()}' to binary 'operator-'
 #define gettime() (clock() - stime)
                    ~~~~~~~~^~~
/in/foo.cc:267:12: note: in expansion of macro 'gettime'
     while (gettime() + 2*avg3 <= Limit) {
            ^~~~~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:276:19: error: assignment of function 'int stime(const time_t*)'
     stime = clock();
                   ^
/in/foo.cc:276:19: error: cannot convert 'clock_t {aka long int}' to 'int(const time_t*) throw () {aka int(const long int*) throw ()}' in assignment
/in/foo.cc:13:28: error: invalid operands of types 'clock_t {aka long int}' and 'int(const time_t*) throw () {aka int(const long int*) throw ()}' to binary 'operator-'
 #define gettime() (clock() - stime)
                    ~~~~~~~~^~~
/in/foo.cc:299:51: note: in expansion of macro 'gettime'
     cout << avg2 << ' ' << avg3 << ' ' << (float)(gettime()) / 1000 << '\n';
                                                   ^~~~~~~

信息

递交者
类型
递交
题目
P1000 A+B Problem
语言
C++
递交时间
2020-11-07 23:29:58
评测时间
2020-11-07 23:29:58
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes