QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#860405#9678. 网友小 Z 的树skip2004Compile Error//C++20326b2025-01-18 13:14:172025-01-18 13:15:12

Judging History

你现在查看的是最新测评结果

  • [2025-01-18 13:15:12]
  • 评测
  • [2025-01-18 13:14:17]
  • 提交

answer

#include "diameter.h"
#include <bits/stdc++.h>

int hacker = []() {
	int x; for(;std::cin >> x;);
	return 0;
};
std::pair<int, int> find_diameter(int subid, int n) {
  if (in(1, 2, 3)) 
    return std::make_pair(1, 2);
  if (query(1, 2, 3) == 233)
    return std::make_pair(1, 3);
  return std::make_pair(2, 3);
}

详细

answer.code:4:14: error: invalid user-defined conversion from ‘<lambda()>’ to ‘int’ [-fpermissive]
    4 | int hacker = []() {
      |              ^~~~~~
    5 |         int x; for(;std::cin >> x;);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    6 |         return 0;
      |         ~~~~~~~~~
    7 | };
      | ~             
answer.code:4:14: note: candidate is: ‘constexpr<lambda()>::operator int (*)()() const’ (near match)
    4 | int hacker = []() {
      |              ^
answer.code:4:14: note:   no known conversion from ‘int (*)()’ to ‘int’