F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_38739888_11971.c:3:5: error: variably modified 'f' at file scope
    3 | int f[N];
      |     ^
0_0_38739888_11971.c: In function 'solve':
0_0_38739888_11971.c:8:5: error: 'vector' undeclared (first use in this function)
    8 |     vector<Good>goods;
      |     ^~~~~~
0_0_38739888_11971.c:8:5: note: each undeclared identifier is reported only once for each function it appears in
0_0_38739888_11971.c:8:12: error: 'Good' undeclared (first use in this function)
    8 |     vector<Good>goods;
      |            ^~~~
0_0_38739888_11971.c:8:17: error: 'goods' undeclared (first use in this function)
    8 |     vector<Good>goods;
      |                 ^~~~~
0_0_38739888_11971.c:9:9: error: 'cin' undeclared (first use in this function)
    9 |         cin>>n>>m;
      |         ^~~
0_0_38739888_11971.c:15:41: error: expected expression before '{' token
   15 |                         goods.push_back({k*v,k*w});
      |                                         ^
0_0_38739888_11971.c:17:40: error: expected expression before '{' token
   17 |                 if(s>0)goods.push_back({s*v,s*w});
      |                                        ^
0_0_38739888_11971.c:19:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   19 |         for (auto it:goods){
      |                     ^
0_0_38739888_11971.c:20:36: error: 'it' undeclared (first use in this function); did you mean 'int'?
   20 |                 for (int j=n; j >= it.v; j--)f[j] = max(f[j], f[j - it.v] + it.w);
      |                                    ^~
      |                                    int
0_0_38739888_11971.c:22:9: error: 'cout' undeclared (first use in this function)
   22 |         cout<<f[m]<<endl;
      |         ^~~~
0_0_38739888_11971.c:22:21: error: 'endl' undeclared (first use in this function)
   22 |         cout<<f[m]<<endl;
      |                     ^~~~
0_0_38739888_11971.c: In function 'main':
0_0_38739888_11971.c:26:5: error: 'cin' undeclared (first use in this function)
   26 |     cin>>i;
      |     ^~~


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2025 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.001000(s) query 1, Server time : 2025-02-18 21:33:26, Gzip enabled