QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#261429#7749. A Simple MST Problemucup-team2499#Compile Error//C++203.3kb2023-11-22 21:30:112023-11-22 21:30:11

详细

answer.code: In function ‘int brute_force(int, int, auto:11&)’:
answer.code:14:10: error: ‘function’ is not a member of ‘std’
   14 |     std::function<int(int)> getf = [&](int node) {
      |          ^~~~~~~~
answer.code:4:1: note: ‘std::function’ is defined in header ‘<functional>’; did you forget to ‘#include <functional>’?
    3 | #include <numeric>
  +++ |+#include <functional>
    4 | 
answer.code:14:19: error: expected primary-expression before ‘int’
   14 |     std::function<int(int)> getf = [&](int node) {
      |                   ^~~
answer.code: In lambda function:
answer.code:18:13: error: there are no arguments to ‘getf’ that depend on a template parameter, so a declaration of ‘getf’ must be available [-fpermissive]
   18 |         x = getf(x), y = getf(y);
      |             ^~~~
answer.code:18:13: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
answer.code:18:26: error: there are no arguments to ‘getf’ that depend on a template parameter, so a declaration of ‘getf’ must be available [-fpermissive]
   18 |         x = getf(x), y = getf(y);
      |                          ^~~~
answer.code: In instantiation of ‘int brute_force(int, int, auto:11&) [with auto:11 = std::vector<int>]’:
answer.code:130:26:   required from here
answer.code:18:17: error: ‘getf’ was not declared in this scope; did you mean ‘getw’?
   18 |         x = getf(x), y = getf(y);
      |             ~~~~^~~
      |             getw
answer.code:18:30: error: ‘getf’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
   18 |         x = getf(x), y = getf(y);
      |                          ~~~~^~~
answer.code:35:17: error: ‘getf’ was not declared in this scope; did you mean ‘getw’?
   35 |         if (getf(p.first) == getf(p.second)) {
      |             ~~~~^~~~~~~~~
      |             getw
answer.code:35:34: error: ‘getf’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
   35 |         if (getf(p.first) == getf(p.second)) {
      |                              ~~~~^~~~~~~~~~