/ Vijos /

记录详情

Compile Error

/in/foo.cc:7:16: error: 'long long int time [25][210]' redeclared as different kind of symbol
 LL time[25][210];
                ^
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: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:12:38: error: ISO C++ forbids applying 'sizeof' to an expression of function type [-fpermissive]
  cin>>n>>m; memset(time,0,sizeof(time));
                                      ^
/in/foo.cc:12:39: error: invalid conversion from 'time_t (*)(time_t*) throw () {aka long int (*)(long int*) throw ()}' to 'void*' [-fpermissive]
  cin>>n>>m; memset(time,0,sizeof(time));
                                       ^
In file included from /in/foo.cc:2:0:
/usr/include/string.h:62:14: note:   initializing argument 1 of 'void* memset(void*, int, size_t)'
 extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
              ^~~~~~
/in/foo.cc:16:10: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    time[i][j]=a;
          ^
/in/foo.cc:16:13: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    time[i][j]=a;
             ^
/in/foo.cc:16:15: error: assignment of read-only location '*(time + (((sizetype)i) + ((sizetype)j)))'
    time[i][j]=a;
               ^
/in/foo.cc:16:15: error: cannot convert 'int' to 'time_t(time_t*) throw () {aka long int(long int*) throw ()}' in assignment
/in/foo.cc:17:32: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    for(int k=1;k<=b;k++) time[i][j]=time[i][j]*j;
                                ^
/in/foo.cc:17:35: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    for(int k=1;k<=b;k++) time[i][j]=time[i][j]*j;
                                   ^
/in/foo.cc:17:43: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    for(int k=1;k<=b;k++) time[i][j]=time[i][j]*j;
                                           ^
/in/foo.cc:17:46: warning: pointer to a function used in arithmetic [-Wpointer-arith]
    for(int k=1;k<=b;k++) time[i][j]=time[i][j]*j;
                                              ^
/in/foo.cc:17:47: error: invalid operands of types 'time_t(time_t*) throw () {aka long int(long int*) throw ()}' and 'int' to binary 'operator*'
    for(int k=1;k<=b;k++) time[i][j]=time[i][j]*j;
                                     ~~~~~~~~~~^~
/in/foo.cc:20:26: warning: overflow in implicit constant conversion [-Woverflow]
  memset(dp,INF,sizeof(dp)); dp[0]=0;
                          ^
/in/foo.cc:24:35: warning: pointer to a function used in arithmetic [-Wpointer-arith]
     dp[j]=min(dp[j],dp[j-k]+time[i][k]);
                                   ^
/in/foo.cc:24:38: warning: pointer to a function used in arithmetic [-Wpointer-arith]
     dp[j]=min(dp[j],dp[j-k]+time[i][k]);
                                      ^
/in/foo.cc:24:38: warning: pointer to a function used in arithmetic [-Wpointer-arith]
/in/foo.cc:24:39: error: no matching function for call to 'min(long long int&, time_t (*)(time_t*) throw ())'
     dp[j]=min(dp[j],dp[j-k]+time[i][k]);
                                       ^
In file included from /usr/include/c++/6/bits/char_traits.h:39:0,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_algobase.h:195:5: note: candidate: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^~~
/usr/include/c++/6/bits/stl_algobase.h:195:5: note:   template argument deduction/substitution failed:
/in/foo.cc:24:39: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'time_t (*)(time_t*) throw () {aka long int (*)(long int*) throw ()}')
     dp[j]=min(dp[j],dp[j-k]+time[i][k]);
                                       ^
In file included from /usr/include/c++/6/bits/char_traits.h:39:0,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_algobase.h:243:5: note: candidate: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~
/usr/include/c++/6/bits/stl_algobase.h:243:5: note:   template argument deduction/substitution failed:
/in/foo.cc:24:39: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'time_t (*)(time_t*) throw () {aka long int (*)(long int*) throw ()}')
     dp[j]=min(dp[j],dp[j-k]+time[i][k]);
                                       ^
In file included from /usr/include/c++/6/algorithm:62:0,
                 from /in/foo.cc:3:
/usr/include/c++/6/bits/stl_algo.h:3447:5: note: candidate: template<class _Tp> _Tp std::min(std::initializer_list<_Tp>)
     min(initializer_list<_Tp> __l)
     ^~~
/usr/include/c++/6/bits/stl_algo.h:3447:5: note:   template argument deduction/substitution failed:
/in/foo.cc:24:39: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
     dp[j]=min(dp[j],dp[j-k]+time[i][k]);
                                       ^
In file included from /usr/include/c++/6/algorithm:62:0,
                 from /in/foo.cc:3:
/usr/include/c++/6/bits/stl_algo.h:3453:5: note: candidate: template<class _Tp, class _Compare> _Tp std::min(std::initializer_list<_Tp>, _Compare)
     min(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
/usr/include/c++/6/bits/stl_algo.h:3453:5: note:   template argument deduction/substitution failed:
/in/foo.cc:24:39: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
     dp[j]=min(dp[j],dp[j-k]+time[i][k]);
                                       ^

信息

递交者
类型
递交
题目
P1198 最佳课题选择
语言
C++
递交时间
2020-03-04 00:44:09
评测时间
2020-03-04 00:44:09
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes