QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#861718#9982. Staircase Museumucup-team311#Compile Error//C++232.0kb2025-01-18 19:25:032025-01-18 19:25:16

Details

answer.code: In function ‘void solve()’:
answer.code:62:8: error: ‘function’ is not a member of ‘std’
   62 |   std::function<ll(ll, ll)> solve = [&](ll x, ll y) {
      |        ^~~~~~~~
answer.code:20:1: note: ‘std::function’ is defined in header ‘<functional>’; this is probably fixable by adding ‘#include <functional>’
   19 | #include <unordered_set>
  +++ |+#include <functional>
   20 | #include <vector>
answer.code:62:26: error: expression list treated as compound expression in functional cast [-fpermissive]
   62 |   std::function<ll(ll, ll)> solve = [&](ll x, ll y) {
      |                          ^
answer.code:62:19: error: expected primary-expression before ‘(’ token
   62 |   std::function<ll(ll, ll)> solve = [&](ll x, ll y) {
      |                   ^
answer.code:62:22: error: expected primary-expression before ‘,’ token
   62 |   std::function<ll(ll, ll)> solve = [&](ll x, ll y) {
      |                      ^
answer.code:62:26: error: expected primary-expression before ‘)’ token
   62 |   std::function<ll(ll, ll)> solve = [&](ll x, ll y) {
      |                          ^
answer.code: In lambda function:
answer.code:70:27: error: too many arguments to function ‘void solve()’
   70 |       ans = max(ans, solve(it->first, it->second) + 1);
      |                      ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
answer.code:41:6: note: declared here
   41 | void solve() {
      |      ^~~~~
answer.code:70:51: error: invalid operands of types ‘void’ and ‘int’ to binary ‘operator+’
   70 |       ans = max(ans, solve(it->first, it->second) + 1);
      |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
      |                           |                         |
      |                           void                      int
answer.code:74:27: error: too many arguments to function ‘void solve()’
   74 |       ans = max(ans, solve(it->first, it->second) + 1);
      |                      ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
answer.code:41:6: note: declared here
   41 | void solve() {
      |      ^~~~~
answer.code:74:51: error: invalid operands of types ‘void’ and ‘int’ to binary ‘operator+’
   74 |       ans = max(ans, solve(it->first, it->second) + 1);
      |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
      |                           |                         |
      |                           void                      int
answer.code: In function ‘void solve()’:
answer.code:78:16: error: too many arguments to function ‘void solve()’
   78 |   cout << solve(0, l[0]) << "\n";
      |           ~~~~~^~~~~~~~~
answer.code:41:6: note: declared here
   41 | void solve() {
      |      ^~~~~
answer.code:78:8: error: no match for ‘operator<<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘void’)
   78 |   cout << solve(0, l[0]) << "\n";
      |   ~~~~ ^~ ~~~~~~~~~~~~~~
      |   |            |
      |   |            void
      |   std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/iostream:41,
                 from answer.code:10:
/usr/include/c++/14/ostream:116:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]’
  116 |       operator<<(__ostream_type& (*__pf)(__ostream_type&))
      |       ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note:   no known conversion for argument 1 from ‘void’ to ‘std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)’ {aka ‘std::basic_ostream<char>& (*)(std::basic_ostream<char>&)’}
  116 |       operator<<(__ostream_type& (*__pf)(__ostream_type&))
      |                  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]’
  125 |       operator<<(__ios_type& (*__pf)(__ios_type&))
      |       ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note:   no known conversion for argument 1 from ‘void’ to ‘std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)’ {aka ‘std::basic_ios<char>& (*)(std::basic_ios<char>&)’}
  125 |       operator<<(__ios_type& (*__pf)(__ios_type&))
      |                  ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]’
  135 |       operator<<(ios_base& (*__pf) (ios_base&))
      |       ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note:   no known conversion for...