QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#32991#141. 8 染色flowerCompile Error//C++143.3kb2022-05-26 11:57:342023-01-15 15:29:55

詳細信息

Bob.code: In function ‘std::vector<int> {anonymous}::solve(int, int, std::vector<int>, std::vector<int>, std::vector<int>)’:
Bob.code:19:30: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
   19 |                         auto [d, u] = q.top(); q.pop();
      |                              ^
Bob.code:37:32: error: no match for call to ‘({anonymous}::solve(int, int, std::vector<int>, std::vector<int>, std::vector<int>)::<lambda(auto:1&, int)>) ({anonymous}::solve(int, int, std::vector<int>, std::vector<int>, std::vector<int>)::<lambda(auto:1&, int)>&, std::vector<int>&)’
   37 |                         fa[find(find, u)] = find(find, v);
      |                            ~~~~^~~~~~~~~
Bob.code:35:29: note: candidate: ‘template<class auto:1> {anonymous}::solve(int, int, std::vector<int>, std::vector<int>, std::vector<int>)::<lambda(auto:1&, int)>’
   35 |                 auto find = [&] (auto &self, int u) -> int {return fa[u] == u ? u : fa[u] = self(self, fa[u]);};
      |                             ^
Bob.code:35:29: note:   template argument deduction/substitution failed:
Bob.code:37:39: note:   cannot convert ‘u’ (type ‘std::vector<int>’) to type ‘int’
   37 |                         fa[find(find, u)] = find(find, v);
      |                                       ^
Bob.code:37:49: error: no match for call to ‘({anonymous}::solve(int, int, std::vector<int>, std::vector<int>, std::vector<int>)::<lambda(auto:1&, int)>) ({anonymous}::solve(int, int, std::vector<int>, std::vector<int>, std::vector<int>)::<lambda(auto:1&, int)>&, std::vector<int>&)’
   37 |                         fa[find(find, u)] = find(find, v);
      |                                             ~~~~^~~~~~~~~
Bob.code:35:29: note: candidate: ‘template<class auto:1> {anonymous}::solve(int, int, std::vector<int>, std::vector<int>, std::vector<int>)::<lambda(auto:1&, int)>’
   35 |                 auto find = [&] (auto &self, int u) -> int {return fa[u] == u ? u : fa[u] = self(self, fa[u]);};
      |                             ^
Bob.code:35:29: note:   template argument deduction/substitution failed:
Bob.code:37:56: note:   cannot convert ‘v’ (type ‘std::vector<int>’) to type ‘int’
   37 |                         fa[find(find, u)] = find(find, v);
      |                                                        ^