错误解释

CompileError!

编译信息

main.cpp: In function \xe2\x80\x98TreeNode* buildTree(const std::map<int, std::pair<int, char> >&)\xe2\x80\x99:\nmain.cpp:40:5: error: \xe2\x80\x98set\xe2\x80\x99 was not declared in this scope\n 40 | set<int> childNodes;\n | ^~~\nmain.cpp:5:1: note: \xe2\x80\x98std::set\xe2\x80\x99 is defined in header \xe2\x80\x98<set>\xe2\x80\x99; did you forget to \xe2\x80\x98#include <set>\xe2\x80\x99?\n 4 | #include <map>\n +++ |+#include <set>\n 5 | \nmain.cpp:40:9: error: expected primary-expression before \xe2\x80\x98int\xe2\x80\x99\n 40 | set<int> childNodes;\n | ^~~\nmain.cpp:42:9: error: \xe2\x80\x98childNodes\xe2\x80\x99 was not declared in this scope\n 42 | childNodes.insert(it->second.first);\n | ^~~~~~~~~~\nmain.cpp:46:13: error: \xe2\x80\x98childNodes\xe2\x80\x99 was not declared in this scope\n 46 | if (childNodes.find(it->first) == childNodes.end()) {\n | ^~~~~~~~~~\n