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_38934876_17064.cpp: In function 'int main()':
0_0_38934876_17064.cpp:19:17: error: 'memset' was not declared in this scope
   19 |                 memset(dp, 0, sizeof(dp));
      |                 ^~~~~~
0_0_38934876_17064.cpp:4:1: note: 'memset' is defined in header '<cstring>'; did you forget to '#include <cstring>'?
    3 | #include<algorithm>
  +++ |+#include <cstring>
    4 | #include<string>
0_0_38934876_17064.cpp:21:49: error: 'int node::p' is private within this context
   21 |                         scanf("%d %d %d", &s[i].p, &s[i].q, &s[i].v);
      |                                                 ^
0_0_38934876_17064.cpp:11:13: note: declared private here
   11 |         int p, q, v;
      |             ^
0_0_38934876_17064.cpp:21:58: error: 'int node::q' is private within this context
   21 |                         scanf("%d %d %d", &s[i].p, &s[i].q, &s[i].v);
      |                                                          ^
0_0_38934876_17064.cpp:11:16: note: declared private here
   11 |         int p, q, v;
      |                ^
0_0_38934876_17064.cpp:21:67: error: 'int node::v' is private within this context
   21 |                         scanf("%d %d %d", &s[i].p, &s[i].q, &s[i].v);
      |                                                                   ^
0_0_38934876_17064.cpp:11:19: note: declared private here
   11 |         int p, q, v;
      |                   ^
0_0_38934876_17064.cpp:22:30: error: 'int node::m' is private within this context
   22 |                         s[i].m = s[i].q - s[i].p;
      |                              ^
0_0_38934876_17064.cpp:12:13: note: declared private here
   12 |         int m;
      |             ^
0_0_38934876_17064.cpp:22:39: error: 'int node::q' is private within this context
   22 |                         s[i].m = s[i].q - s[i].p;
      |                                       ^
0_0_38934876_17064.cpp:11:16: note: declared private here
   11 |         int p, q, v;
      |                ^
0_0_38934876_17064.cpp:22:48: error: 'int node::p' is private within this context
   22 |                         s[i].m = s[i].q - s[i].p;
      |                                                ^
0_0_38934876_17064.cpp:11:13: note: declared private here
   11 |         int p, q, v;
      |             ^
0_0_38934876_17064.cpp:26:51: error: 'int node::p' is private within this context
   26 |                         for (int j = M; j >= s[i].p; j--) {
      |                                                   ^
0_0_38934876_17064.cpp:11:13: note: declared private here
   11 |         int p, q, v;
      |             ^
0_0_38934876_17064.cpp:27:47: error: 'int node::q' is private within this context
   27 |                                 if (j >= s[i].q) {
      |                                               ^
0_0_38934876_17064.cpp:11:16: note: declared private here
   11 |         int p, q, v;
      |                ^
0_0_38934876_17064.cpp:28:72: error: 'int node::p' is private within this context
   28 |                                         dp[j] = max(dp[j], dp[j - s[i].p] + s[i].v);
      |                                                                        ^
0_0_38934876_17064.cpp:11:13: note: declared private here
   11 |         int p, q, v;
      |             ^
0_0_38934876_17064.cpp:28:82: error: 'int node::v' is private within this context
   28 |                                         dp[j] = max(dp[j], dp[j - s[i].p] + s[i].v);
      |                                                                                  ^
0_0_38934876_17064.cpp:11:19: note: declared private here
   11 |         int p, q, v;
      |                   ^
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algobase.h:71,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/string:51,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/locale_classes.h:40,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/ios_base.h:41,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/ios:44,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/ostream:40,
                 from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/iostream:41,
                 from 0_0_38934876_17064.cpp:1:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_less_iter::operator()(_Iterator1, _Iterator2) const [with _Iterator1 = node*; _Iterator2 = node*]':
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:1819:14:   required from 'constexpr void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = node*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:1859:25:   required from 'constexpr void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = node*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:1950:31:   required from 'constexpr void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = node*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:4861:18:   required from 'constexpr void std::sort(_RAIter, _RAIter) [with _RAIter = node*]'
0_0_38934876_17064.cpp:24:7:   required from here
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/predefined_ops.h:45:23: error: 'const bool node::operator<(const node&) const' is private within this context
   45 |       { return *__it1 < *__it2; }
      |                ~~~~~~~^~~~~~~~
0_0_38934876_17064.cpp:8:20: note: declared private here
    8 |         const bool operator<(const node&rhs)const {
      |                    ^~~~~~~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Val_less_iter::operator()(_Value&, _Iterator) const [with _Value = node; _Iterator = node*]':
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:1799:20:   required from 'constexpr void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = node*; _Compare = __gnu_cxx::__ops::_Val_less_iter]'
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:1827:36:   required from 'constexpr void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = node*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:1859:25:   required from 'constexpr void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = node*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:1950:31:   required from 'constexpr void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = node*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:4861:18:   required from 'constexpr void std::sort(_RAIter, _RAIter) [with _RAIter = node*]'
0_0_38934876_17064.cpp:24:7:   required from here
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/predefined_ops.h:98:22: error: 'const bool node::operator<(const node&) const' is private within this context
   98 |       { return __val < *__it; }
      |                ~~~~~~^~~~~~~
0_0_38934876_17064.cpp:8:20: note: declared private here
    8 |         const bool operator<(const node&rhs)const {
      |                    ^~~~~~~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_less_val::operator()(_Iterator, _Value&) const [with _Iterator = node*; _Value = node]':
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_heap.h:140:48:   required from 'constexpr void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare&) [with _RandomAccessIterator = node*; _Distance = long long int; _Tp = node; _Compare = __gnu_cxx::__ops::_Iter_less_val]'
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_heap.h:247:23:   required from 'constexpr void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = node*; _Distance = long long int; _Tp = node; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_heap.h:356:22:   required from 'constexpr void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = node*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:1635:23:   required from 'constexpr void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = node*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_algo.h:1910:25:   required from 'constexpr void std::__partial_sor


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-28 13:57:10, Gzip enabled