/ Vijos /

记录详情

Compile Error

foo.cc:14:22: error: 'int time [105][105]' redeclared as different kind of symbol
 int n,m,time[MAX][MAX];
                      ^
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 foo.cc:1:
/usr/include/time.h:75:15: note: previous declaration 'time_t time(time_t*)'
 extern time_t time (time_t *__timer) __THROW;
               ^~~~
foo.cc: In function 'int main()':
foo.cc:28:36: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   for (int j = 1;j <= n;++j) time[i][j] = time[j][i] = read ();
                                    ^
foo.cc:28:39: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   for (int j = 1;j <= n;++j) time[i][j] = time[j][i] = read ();
                                       ^
foo.cc:28:49: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   for (int j = 1;j <= n;++j) time[i][j] = time[j][i] = read ();
                                                 ^
foo.cc:28:52: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   for (int j = 1;j <= n;++j) time[i][j] = time[j][i] = read ();
                                                    ^
foo.cc:28:62: error: assignment of read-only location '*(time + (((sizetype)j) + ((sizetype)i)))'
   for (int j = 1;j <= n;++j) time[i][j] = time[j][i] = read ();
                                                              ^
foo.cc:28:62: error: cannot convert 'int' to 'time_t(time_t*) throw () {aka long int(long int*) throw ()}' in assignment
foo.cc:33:44: warning: pointer to a function used in arithmetic [-Wpointer-arith]
     if (j - a[i].t - time[a[dp[j].first].id][a[i].id] >= 0)
                                            ^
foo.cc:33:53: warning: pointer to a function used in arithmetic [-Wpointer-arith]
     if (j - a[i].t - time[a[dp[j].first].id][a[i].id] >= 0)
                                                     ^
foo.cc:33:20: error: invalid operands of types 'int' and 'time_t(time_t*) throw () {aka long int(long int*) throw ()}' to binary 'operator-'
     if (j - a[i].t - time[a[dp[j].first].id][a[i].id] >= 0)
         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:34:55: error: 'dis' was not declared in this scope
      dp[j].second = max (dp[j].second,dp[j - a[i].t - dis[a[dp[j].first].id][a[i].id]].second + a[i].val),dp[j].first = i;
                                                       ^~~
foo.cc:34:55: note: suggested alternative: 'div'
      dp[j].second = max (dp[j].second,dp[j - a[i].t - dis[a[dp[j].first].id][a[i].id]].second + a[i].val),dp[j].first = i;
                                                       ^~~
                                                       div
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1370 采果子
语言
C++
递交时间
2021-10-10 15:44:03
评测时间
2021-10-10 15:44:03
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes