记录详情

Compile Error

/in/foo.cc: In function 'int Solve2(int, int, int*, int*)':
/in/foo.cc:11:11: error: invalid conversion from 'int (*)[(t + 1)]' to 'int' [-fpermissive]
   11 |  memset(0,dp,sizeof(dp));//初始化为0,背包内未放入物品
      |           ^~
      |           |
      |           int (*)[(t + 1)]
In file included from /usr/include/c++/12/cstring:42,
                 from /usr/include/x86_64-linux-gnu/c++/12/bits/stdc++.h:48,
                 from /in/foo.cc:1:
/usr/include/string.h:61:37: note:   initializing argument 2 of 'void* memset(void*, int, size_t)'
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                                 ~~~~^~~
/in/foo.cc:11:8: warning: argument 1 null where non-null expected [-Wnonnull]
   11 |  memset(0,dp,sizeof(dp));//初始化为0,背包内未放入物品
      |  ~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/string.h:61:14: note: in a call to function 'void* memset(void*, int, size_t)' declared 'nonnull'
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |              ^~~~~~
/in/foo.cc: At global scope:
/in/foo.cc:18:2: error: '\U0000200bint' does not name a type
   18 | }​int main(){    int n,t;    cin>>n>>t;    int v[n],w[n];    for(int i=0;i<n;i++) cin>>v[i]>>w[i];
      |  ^~~

信息

递交者
类型
自测
题目
P1483 I. Blue Bridge Cup
语言
C++
递交时间
2025-03-17 15:40:06
评测时间
2025-03-17 15:40:06
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes