1 条题解

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

    思路

    至17天分别累加三类奖牌并合计。按题面规定的输入输出协议处理;数据、边界和算法核验记录保存在本批教师资料。

    参考程序(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=1064;
    int n;cin>>n;long long a=0,b=0,c=0,x,y,z;while(n--){cin>>x>>y>>z;a+=x;b+=y;c+=z;}cout<<a<<" "<<b<<" "<<c<<" "<<a+b+c;
    cout<<"\n";return 0;}
    
    • 1

    信息

    ID
    982
    时间
    1000ms
    内存
    64MiB
    难度
    入门
    标签
    递交数
    1
    已通过
    1
    上传者