Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
75224 sh25_wangtaojie 救援 C++ 编译错误 0 MS 0 KB 883 2025-12-05 15:34:07

Tests(0/0):


#include <iostream> #include <cmath> #include <vector> #include <algorithm> using namespace std; int main() { int n; cin >> n; vector<pair<pair<double, double>, int>> roofs(n); for (int i = 0; i < n; ++i) { double x, y; int people; cin >> x >> y >> people; roofs[i] = {{x, y}, people}; } // 按距离大本营排序 sort(roofs.begin(), roofs.end(), [](const auto& a, const auto& b) { return hypot(a.first.first, a.first.second) < hypot(b.first.first, b.first.second); }); double total_time = 0; for (const auto& roof : roofs) { double distance = hypot(roof.first.first, roof.first.second); total_time += 2 * distance / 50 + roof.second + 0.5 * roof.second; } // 向上取整 cout << static_cast<int>(ceil(total_time)) << endl; return 0; }


测评信息: