/ Vijos /

记录详情

Compile Error

/in/foo.cc:6:25: error: 'int time [10001]' redeclared as different kind of symbol
 int f[10001], time[10001], importance[10001];
                         ^
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:19:15: warning: pointer to a function used in arithmetic [-Wpointer-arith]
         time[i] = 100*a;
               ^
/in/foo.cc:19:23: error: assignment of read-only location '*(time + ((sizetype)i))'
         time[i] = 100*a;
                       ^
/in/foo.cc:19:23: error: cannot convert 'double' to 'time_t(time_t*) throw () {aka long int(long int*) throw ()}' in assignment
/in/foo.cc:22:35: warning: pointer to a function used in arithmetic [-Wpointer-arith]
         for(int j = t; j >= time[i]; j--)
                                   ^
/in/foo.cc:22:35: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
/in/foo.cc:23:43: warning: pointer to a function used in arithmetic [-Wpointer-arith]
             f[j] = imax(f[j], f[j - time[i]] + importance[i]);
                                           ^
/in/foo.cc:23:35: error: invalid operands of types 'int' and 'time_t(time_t*) throw () {aka long int(long int*) throw ()}' to binary 'operator-'
             f[j] = imax(f[j], f[j - time[i]] + importance[i]);
                                 ~~^~~~~~~~~

信息

递交者
类型
递交
题目
P1836 HYS与七夕节大作战
语言
C++
递交时间
2019-11-04 11:07:57
评测时间
2019-11-04 11:07:57
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes