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_39559454_41.cpp: In function 'long long int solve(long long int)':
0_0_39559454_41.cpp:16:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   16 |     cin >> n >> m;
      |     ^~~
      |     std::cin
In file included from .\stdc++.h:146:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
0_0_39559454_41.cpp:17:5: error: 'vector' was not declared in this scope
   17 |     vector<int>du(n + 1, 0);
      |     ^~~~~~
0_0_39559454_41.cpp:17:5: note: suggested alternatives:
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/vector:66,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/functional:64,
                 from .\stdc++.h:53:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_vector.h:423:11: note:   'std::vector'
  423 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
0_0_39559454_41.cpp:2:13: error: expected primary-expression before 'long'
    2 | #define int long long
      |             ^~~~
0_0_39559454_41.cpp:17:12: note: in expansion of macro 'int'
   17 |     vector<int>du(n + 1, 0);
      |            ^~~
0_0_39559454_41.cpp:2:13: error: expected primary-expression before 'long'
    2 | #define int long long
      |             ^~~~
0_0_39559454_41.cpp:18:19: note: in expansion of macro 'int'
   18 |     vector<vector<int>>eg(n + 1);
      |                   ^~~
0_0_39559454_41.cpp:21:9: error: 'eg' was not declared in this scope
   21 |         eg[u].emplace_back(v);
      |         ^~
0_0_39559454_41.cpp:23:9: error: 'du' was not declared in this scope; did you mean 'u'?
   23 |         du[u]++;
      |         ^~
      |         u
0_0_39559454_41.cpp:2:13: error: expected primary-expression before 'long'
    2 | #define int long long
      |             ^~~~
0_0_39559454_41.cpp:28:16: note: in expansion of macro 'int'
   28 |         vector<int>ans(n + 1, 0);
      |                ^~~
0_0_39559454_41.cpp: In lambda function:
0_0_39559454_41.cpp:30:27: error: 'eg' was not declared in this scope
   30 |             for (auto c : eg[x]) {
      |                           ^~
0_0_39559454_41.cpp:33:32: error: 'ans' was not declared in this scope; did you mean 'abs'?
   33 |                 Max = max(Max, ans[x] + ans[c] + (du[x] - 1) * (ksm(2, m) - 1) + 1);
      |                                ^~~
      |                                abs
0_0_39559454_41.cpp:33:51: error: 'du' was not declared in this scope; did you mean 'u'?
   33 |                 Max = max(Max, ans[x] + ans[c] + (du[x] - 1) * (ksm(2, m) - 1) + 1);
      |                                                   ^~
      |                                                   u
0_0_39559454_41.cpp:33:23: error: there are no arguments to 'max' that depend on a template parameter, so a declaration of 'max' must be available [-fpermissive]
   33 |                 Max = max(Max, ans[x] + ans[c] + (du[x] - 1) * (ksm(2, m) - 1) + 1);
      |                       ^~~
0_0_39559454_41.cpp:33:23: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
0_0_39559454_41.cpp:34:26: error: there are no arguments to 'max' that depend on a template parameter, so a declaration of 'max' must be available [-fpermissive]
   34 |                 ans[x] = max(ans[x], ans[c]);
      |                          ^~~
0_0_39559454_41.cpp:36:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   36 |             ans[x] += (du[x] - 1) * (ksm(2, m) - 1) + 1;
      |             ^~~
      |             abs
0_0_39559454_41.cpp:36:24: error: 'du' was not declared in this scope; did you mean 'u'?
   36 |             ans[x] += (du[x] - 1) * (ksm(2, m) - 1) + 1;
      |                        ^~
      |                        u
0_0_39559454_41.cpp: In function 'long long int solve(long long int)':
0_0_39559454_41.cpp:42:9: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
   42 |         pair<int, int>Max;//一位度数-数量, 二维数量
      |         ^~~~
      |         std::pair
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algobase.h:64,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/algorithm:60,
                 from .\stdc++.h:51:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_pair.h:187:12: note: 'std::pair' declared here
  187 |     struct pair
      |            ^~~~
0_0_39559454_41.cpp:2:13: error: expected primary-expression before 'long'
    2 | #define int long long
      |             ^~~~
0_0_39559454_41.cpp:42:14: note: in expansion of macro 'int'
   42 |         pair<int, int>Max;//一位度数-数量, 二维数量
      |              ^~~
0_0_39559454_41.cpp:2:13: error: expected primary-expression before 'long'
    2 | #define int long long
      |             ^~~~
0_0_39559454_41.cpp:43:21: note: in expansion of macro 'int'
   43 |         vector<pair<int, int>>dep(n + 1, {0, 0});
      |                     ^~~
0_0_39559454_41.cpp:43:48: error: expected primary-expression before ')' token
   43 |         vector<pair<int, int>>dep(n + 1, {0, 0});
      |                                                ^
0_0_39559454_41.cpp:44:53: error: 'pair' does not name a type
   44 |         auto dfs = [&](auto self, int x, int fa) -> pair<int, int> {
      |                                                     ^~~~
0_0_39559454_41.cpp:44:57: error: expected '{' before '<' token
   44 |         auto dfs = [&](auto self, int x, int fa) -> pair<int, int> {
      |                                                         ^
0_0_39559454_41.cpp:2:13: error: expected primary-expression before 'long'
    2 | #define int long long
      |             ^~~~
0_0_39559454_41.cpp:44:58: note: in expansion of macro 'int'
   44 |         auto dfs = [&](auto self, int x, int fa) -> pair<int, int> {
      |                                                          ^~~
0_0_39559454_41.cpp:56:17: error: 'Max' was not declared in this scope
   56 |         return (Max.first * (ksm(2, m) - 1 + M) % M + Max.second) % M;
      |                 ^~~
0_0_39559454_41.cpp: In function 'int main()':
0_0_39559454_41.cpp:62:5: error: 'ios' has not been declared
   62 |     ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
      |     ^~~
0_0_39559454_41.cpp:62:34: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   62 |     ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
      |                                  ^~~
      |                                  std::cin
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
0_0_39559454_41.cpp:62:52: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   62 |     ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
      |                                                    ^~~~
      |                                                    std::cout
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
0_0_39559454_41.cpp:66:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   66 |         cout << solve(_) << endl;
      |                             ^~~~
      |                             std::endl
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/unique_ptr.h:42,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/memory:78,
                 from .\stdc++.h:56:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/ostream:735:5: note: 'std::endl' declared here
  735 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
0_0_39559454_41.cpp: In instantiation of 'solve(long long int)::<lambda(auto:54, long long int, long long int)> [with auto:54 = solve(long long int)::<lambda(auto:54, long long int, long long int)>]':
0_0_39559454_41.cpp:38:12:   required from here
0_0_39559454_41.cpp:33:83: error: 'max' was not declared in this scope
   33 |                 Max = max(Max, ans[x] + ans[c] + (du[x] - 1) * (ksm(2, m) - 1) + 1);
      |                                                                                   ^
0_0_39559454_41.cpp:33:83: note: suggested alternatives:
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/algorithm:61:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:5805:5: note:   'std::max'
 5805 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/algorithm:63:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/ranges_algo.h:2928:29: note:   'std::ranges::max'
 2928 |   inline constexpr __max_fn max{};
      |                             ^~~


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-09-20 09:45:46, Gzip enabled