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_38921339_17398.cpp:2:14: error: 'MAX' was not declared in this scope
    2 | int n, m, dp[MAX], num[MAX], val[MAX];
      |              ^~~
0_0_38921339_17398.cpp:2:24: error: 'MAX' was not declared in this scope
    2 | int n, m, dp[MAX], num[MAX], val[MAX];
      |                        ^~~
0_0_38921339_17398.cpp:2:34: error: 'MAX' was not declared in this scope
    2 | int n, m, dp[MAX], num[MAX], val[MAX];
      |                                  ^~~
0_0_38921339_17398.cpp:3:1: error: 'vector' does not name a type
    3 | vector<int> tree[MAX], lead;
      | ^~~~~~
0_0_38921339_17398.cpp: In function 'void solv()':
0_0_38921339_17398.cpp:8:16: error: 'cin' was not declared in this scope
    8 |         while (cin >> n >> m)
      |                ^~~
0_0_38921339_17398.cpp:13:37: error: 'MAX' was not declared in this scope
   13 |                 for (int i = 0; i < MAX; i++)
      |                                     ^~~
0_0_38921339_17398.cpp:15:25: error: 'val' was not declared in this scope
   15 |                         val[i] = 0;
      |                         ^~~
0_0_38921339_17398.cpp:17:25: error: 'dp' was not declared in this scope
   17 |                         dp[i] = 0;
      |                         ^~
0_0_38921339_17398.cpp:18:25: error: 'tree' was not declared in this scope
   18 |                         tree[i].clear();
      |                         ^~~~
0_0_38921339_17398.cpp:19:25: error: 'num' was not declared in this scope; did you mean 'enum'?
   19 |                         num[i] = 0;
      |                         ^~~
      |                         enum
0_0_38921339_17398.cpp:26:34: error: 'lead' was not declared in this scope
   26 |                         if (!fa) lead.push_back(i); // 一根就是一组
      |                                  ^~~~
0_0_38921339_17398.cpp:27:25: error: 'tree' was not declared in this scope
   27 |                         tree[fa].push_back(i);     // 平凡的有根树,但有多个根
      |                         ^~~~
0_0_38921339_17398.cpp:28:25: error: 'num' was not declared in this scope; did you mean 'enum'?
   28 |                         num[i] = va;
      |                         ^~~
      |                         enum
0_0_38921339_17398.cpp:31:37: error: 'lead' was not declared in this scope
   31 |                 for (int i = 0; i < lead.size(); i++)
      |                                     ^~~~
0_0_38921339_17398.cpp:33:32: error: 'val' was not declared in this scope
   33 |                         memset(val, 0, sizeof(val));
      |                                ^~~
0_0_38921339_17398.cpp:33:25: error: 'memset' was not declared in this scope
   33 |                         memset(val, 0, sizeof(val));
      |                         ^~~~~~
0_0_38921339_17398.cpp:1:1: note: 'memset' is defined in header '<cstring>'; did you forget to '#include <cstring>'?
  +++ |+#include <cstring>
    1 | // HUD 1561
0_0_38921339_17398.cpp:37:54: error: 'min' was not declared in this scope
   37 |                                 for (int k = 1; k <= min(j, len); k++)
      |                                                      ^~~
0_0_38921339_17398.cpp:39:41: error: 'dp' was not declared in this scope
   39 |                                         dp[j] = max(dp[j], dp[j - k] + val[k]); //平平无奇的分组背包
      |                                         ^~
0_0_38921339_17398.cpp:39:49: error: 'max' was not declared in this scope
   39 |                                         dp[j] = max(dp[j], dp[j - k] + val[k]); //平平无奇的分组背包
      |                                                 ^~~
0_0_38921339_17398.cpp:42:17: error: 'cout' was not declared in this scope
   42 |                 cout << dp[m] << endl;
      |                 ^~~~
0_0_38921339_17398.cpp:42:25: error: 'dp' was not declared in this scope
   42 |                 cout << dp[m] << endl;
      |                         ^~
0_0_38921339_17398.cpp:42:34: error: 'endl' was not declared in this scope
   42 |                 cout << dp[m] << endl;
      |                                  ^~~~
0_0_38921339_17398.cpp: In function 'int dfs(int, int, int)':
0_0_38921339_17398.cpp:48:9: error: 'val' was not declared in this scope; did you mean 'va'?
   48 |         val[cnt] = max(val[cnt], va + num[u]); // 同一代价可获得的最大收获(正确性待定)
      |         ^~~
      |         va
0_0_38921339_17398.cpp:48:39: error: 'num' was not declared in this scope; did you mean 'enum'?
   48 |         val[cnt] = max(val[cnt], va + num[u]); // 同一代价可获得的最大收获(正确性待定)
      |                                       ^~~
      |                                       enum
0_0_38921339_17398.cpp:48:20: error: 'max' was not declared in this scope
   48 |         val[cnt] = max(val[cnt], va + num[u]); // 同一代价可获得的最大收获(正确性待定)
      |                    ^~~
0_0_38921339_17398.cpp:50:14: error: 'tree' was not declared in this scope
   50 |         if (!tree[u].size()) return cnt; // 当到达背包容量最大或走到叶子时,返回最长路径
      |              ^~~~
0_0_38921339_17398.cpp:52:29: error: 'tree' was not declared in this scope
   52 |         for (int i = 0; i < tree[u].size(); 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-11-26 09:34:26, Gzip enabled