1 条题解

  • 0
    @ 2026-10-25 14:06:59

    思路

    组合往返距离与人员上下船耗时,最后整体取整。按题面规定的输入输出协议处理;数据、边界和算法核验记录保存在本批教师资料。

    参考程序(C++11)

    #include <bits/stdc++.h>
    using namespace std;
    long long gcdll(long long a,long long b){while(b){long long t=a%b;a=b;b=t;}return a;}
    int main(){ios::sync_with_stdio(false);cin.tie(nullptr);const int p=1073;
    int n,k;double x,y,s=0;cin>>n;while(n--){cin>>x>>y>>k;s+=hypot(x,y)/25+k*1.5;}cout<<(long long)ceil(s);
    cout<<"\n";return 0;}
    
    • 1

    信息

    ID
    985
    时间
    1000ms
    内存
    64MiB
    难度
    进阶
    标签
    递交数
    1
    已通过
    1
    上传者