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_33289156_476.cpp:6:7: error: 'len' does not name a type
 const len = 1002;
       ^
0_0_33289156_476.cpp:8:11: error: 'len' was not declared in this scope
 int value[len];
           ^
0_0_33289156_476.cpp:9:10: error: 'len' was not declared in this scope
 int cost[len]
          ^
0_0_33289156_476.cpp:11:1: error: expected initializer before 'int'
 int dp[len][len];
 ^
0_0_33289156_476.cpp: In function 'int main()':
0_0_33289156_476.cpp:21:20: error: 'value' was not declared in this scope
             cin >> value[i + 1];
                    ^
0_0_33289156_476.cpp:24:20: error: 'cost' was not declared in this scope
             cin >> cost[i + 1];
                    ^
0_0_33289156_476.cpp:27:16: error: 'dp' was not declared in this scope
         memset(dp, 0, sizeof(int) * len * len);
                ^
0_0_33289156_476.cpp:27:37: error: 'len' was not declared in this scope
         memset(dp, 0, sizeof(int) * len * len);
                                     ^
0_0_33289156_476.cpp:27:46: error: 'memset' was not declared in this scope
         memset(dp, 0, sizeof(int) * len * len);
                                              ^
0_0_33289156_476.cpp:31:21: error: 'cost' was not declared in this scope
                 if (cost[i] > j) {
                     ^
0_0_33289156_476.cpp:34:75: error: 'value' was not declared in this scope
                     dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - cost[i]] + value[i]);
                                                                           ^


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-12-05 06:49:58, Gzip enabled