记录详情

Compile Error

foo.c:2:1: error: unknown type name 'using'
    2 | using namespace std;
      | ^~~~~
foo.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    2 | using namespace std;
      |                 ^~~
foo.c:4:5: error: variably modified 'w' at file scope
    4 | int w[N],v[N],p[N];
      |     ^
foo.c:4:10: error: variably modified 'v' at file scope
    4 | int w[N],v[N],p[N];
      |          ^
foo.c:4:15: error: variably modified 'p' at file scope
    4 | int w[N],v[N],p[N];
      |               ^
foo.c:5:5: error: variably modified 'f' at file scope
    5 | int f[N][N][N];
      |     ^
foo.c:5:5: error: variably modified 'f' at file scope
foo.c:5:5: error: variably modified 'f' at file scope
foo.c: In function 'main':
foo.c:10:9: error: 'cin' undeclared (first use in this function)
   10 |         cin>>W>>V>>n;
      |         ^~~
foo.c:10:9: note: each undeclared identifier is reported only once for each function it appears in
foo.c:18:52: warning: implicit declaration of function 'max' [-Wimplicit-function-declaration]
   18 |                                         f[i][j][k]=max(f[i][j][k],f[i+1][j-w[i]][k-v[i]]+p[i]);
      |                                                    ^~~
foo.c:21:9: error: 'cout' undeclared (first use in this function)
   21 |         cout<<f[1][W][V]<<endl;
      |         ^~~~
foo.c:21:27: error: 'endl' undeclared (first use in this function)
   21 |         cout<<f[1][W][V]<<endl;
      |                           ^~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1021 [蓝桥杯省赛 初级组] 最大购物优惠
语言
C
递交时间
2023-10-22 18:20:48
评测时间
2023-10-22 18:20:49
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes