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_39186761_26762.cpp: In function 'int main()':
0_0_39186761_26762.cpp:7:36: error: 'p' was not declared in this scope
    7 |         for(int i=1;i<=n;i++) cin>>p[i]>>w[i];
      |                                    ^
0_0_39186761_26762.cpp:7:42: error: 'w' was not declared in this scope
    7 |         for(int i=1;i<=n;i++) cin>>p[i]>>w[i];
      |                                          ^
0_0_39186761_26762.cpp:8:46: error: 'w' was not declared in this scope
    8 |         for(int i=1;i<=n;i++) for(int j=m;j>=w[i];j--) d[j]=max(d[j],d[j-w[i]]+p[i]);
      |                                              ^
0_0_39186761_26762.cpp:8:56: error: 'd' was not declared in this scope
    8 |         for(int i=1;i<=n;i++) for(int j=m;j>=w[i];j--) d[j]=max(d[j],d[j-w[i]]+p[i]);
      |                                                        ^
0_0_39186761_26762.cpp:8:80: error: 'p' was not declared in this scope
    8 |         for(int i=1;i<=n;i++) for(int j=m;j>=w[i];j--) d[j]=max(d[j],d[j-w[i]]+p[i]);
      |                                                                                ^
0_0_39186761_26762.cpp:9:15: error: 'd' was not declared in this scope
    9 |         cout<<d[m]<<endl;
      |               ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-29 12:01:28, Gzip enabled