答案错误求条
查看原帖
答案错误求条
1171250
w132326820楼主2025/6/28 10:41

#include <bits/stdc++.h>

using namespace std;

const int N=(int)1e6;

struct IO{
    enum {B=1<<20};
    char b[B],*p=b,*e=b+B;

    IO(){r();}
    void r(){e=b+fread(b,1,B,stdin);p=b;}
    void r(long long &x){
        int s=1;x=0;
        while(*p<48&&*p!='-')if(++p==e)r();
        if(*p=='-')s=-1,p++;
        while(*p>=48&&*p<=57){
            x=x*10+(*p++&15);
            if(p==e)r();
        }
        x*=s;
    }
}fio;

long long n,m,k;

int main(){
    fio.r(n);
    for(int i=1;i<=n;i++){
        fio.r(m);
        k+=m;
    }
    printf("%d",k);
    return 0;
}

2025/6/28 10:41
加载中...