QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#553978#8939. PermutationdanielzCompile Error//C++14758b2024-09-09 00:36:122024-09-09 00:36:13

Details

answer.code:14:22: error: ‘function’ has not been declared
   14 | int bs(int l, int r, function<bool(int)> f) {
      |                      ^~~~~~~~
answer.code:14:30: error: expected ‘,’ or ‘...’ before ‘<’ token
   14 | int bs(int l, int r, function<bool(int)> f) {
      |                              ^
answer.code: In function ‘int bs(int, int, int)’:
answer.code:17:9: error: ‘f’ was not declared in this scope
   17 |     if (f(m)) l = m;
      |         ^
answer.code: In function ‘void ac()’:
answer.code:28:18: error: cannot convert ‘ac()::<lambda(int)>’ to ‘int’
   28 |     bs(1, m - 1, [=](int l) { return query(l, m) == m; }) :
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                  |
      |                  ac()::<lambda(int)>
answer.code:14:22: note:   initializing argument 3 of ‘int bs(int, int, int)’
   14 | int bs(int l, int r, function<bool(int)> f) {
      |                      ^~~~~~~~
answer.code:29:18: error: cannot convert ‘ac()::<lambda(int)>’ to ‘int’
   29 |     bs(m + 1, n, [=](int r) { return query(m, r) != m; }));
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                  |
      |                  ac()::<lambda(int)>
answer.code:14:22: note:   initializing argument 3 of ‘int bs(int, int, int)’
   14 | int bs(int l, int r, function<bool(int)> f) {
      |                      ^~~~~~~~