错误解释

CompileError!

编译信息

main.cpp: In function \xe2\x80\x98int main()\xe2\x80\x99:\nmain.cpp:52:5: error: \xe2\x80\x98unordered_map\xe2\x80\x99 was not declared in this scope\n 52 | unordered_map<int, vector<Point>> components;\n | ^~~~~~~~~~~~~\nmain.cpp:6:1: note: \xe2\x80\x98std::unordered_map\xe2\x80\x99 is defined in header \xe2\x80\x98<unordered_map>\xe2\x80\x99; did you forget to \xe2\x80\x98#include <unordered_map>\xe2\x80\x99?\n 5 | #include <unordered_set>\n +++ |+#include <unordered_map>\n 6 | using namespace std;\nmain.cpp:52:19: error: expected primary-expression before \xe2\x80\x98int\xe2\x80\x99\n 52 | unordered_map<int, vector<Point>> components;\n | ^~~\nmain.cpp:55:9: error: \xe2\x80\x98components\xe2\x80\x99 was not declared in this scope\n 55 | components[root].push_back(points[i]);\n | ^~~~~~~~~~\nmain.cpp:60:22: warning: structured bindings only available with \xe2\x80\x98-std=c++17\xe2\x80\x99 or \xe2\x80\x98-std=gnu++17\xe2\x80\x99\n 60 | for (const auto& [root, pts] : components) {\n | ^\nmain.cpp:60:36: error: \xe2\x80\x98components\xe2\x80\x99 was not declared in this scope; did you mean \xe2\x80\x98comp_centers\xe2\x80\x99?\n 60 | for (const auto& [root, pts] : components) {\n | ^~~~~~~~~~\n | comp_centers\nmain.cpp:63:26: warning: structured bindings only available with \xe2\x80\x98-std=c++17\xe2\x80\x99 or \xe2\x80\x98-std=gnu++17\xe2\x80\x99\n 63 | for (const auto& [other_root, other_pts] : components) {\n | ^\nmain.cpp:69:28: error: \xe2\x80\x98numeric_limits\xe2\x80\x99 was not declared in this scope\n 69 | double min_d = numeric_limits<double>::max();\n | ^~~~~~~~~~~~~~\nmain.cpp:69:43: error: expected primary-expression before \xe2\x80\x98double\xe2\x80\x99\n 69 | double min_d = numeric_limits<double>::max();\n | ^~~~~~\nmain.cpp:82:27: error: \xe2\x80\x98numeric_limits\xe2\x80\x99 was not declared in this scope\n 82 | vector<double> key(K, numeric_limits<double>::max());\n | ^~~~~~~~~~~~~~\nmain.cpp:82:42: error: expected primary-expression before \xe2\x80\x98double\xe2\x80\x99\n 82 | vector<double> key(K, numeric_limits<double>::max());\n | ^~~~~~\nmain.cpp:90:41: error: expected primary-expression before \xe2\x80\x98double\xe2\x80\x99\n 90 | double min_key = numeric_limits<double>::max();\n | ^~~~~~\nmain.cpp:110:22: error: \xe2\x80\x98setprecision\xe2\x80\x99 was not declared in this scope\n 110 | cout << fixed << setprecision(2) << total << endl;\n | ^~~~~~~~~~~~\n