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_38572165_25345.cpp: In function 'int main()':
0_0_38572165_25345.cpp:7:5: error: 'scanf' was not declared in this scope
     scanf("%d",&C);
     ^~~~~
0_0_38572165_25345.cpp:16:9: error: 'memset' was not declared in this scope
         memset(dp,0,sizeof(dp));
         ^~~~~~
0_0_38572165_25345.cpp:16:9: note: 'memset' is defined in header '<cstring>'; did you forget to '#include <cstring>'?
0_0_38572165_25345.cpp:1:1:
+#include <cstring>
 int weight[110],value[110],cnt[110];
0_0_38572165_25345.cpp:16:9:
         memset(dp,0,sizeof(dp));
         ^~~~~~
0_0_38572165_25345.cpp:22:27: error: 'max' was not declared in this scope
                     dp[k]=max(dp[k],dp[k-value[i]]+weight[i]);
                           ^~~
0_0_38572165_25345.cpp:22:27: note: suggested alternative: 'main'
                     dp[k]=max(dp[k],dp[k-value[i]]+weight[i]);
                           ^~~
                           main
0_0_38572165_25345.cpp:25:9: error: 'printf' was not declared in this scope
         printf("%d\n",dp[m]);
         ^~~~~~
0_0_38572165_25345.cpp:25:9: note: 'printf' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?
0_0_38572165_25345.cpp:1:1:
+#include <cstdio>
 int weight[110],value[110],cnt[110];
0_0_38572165_25345.cpp:25:9:
         printf("%d\n",dp[m]);
         ^~~~~~


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-05-20 03:19:09, Gzip enabled