时间限制过于雷霆!
2026-10-24 11:52:29
发布于:四川
3阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
long long n,k;
cin>>n;
cin>>k;
long long x;
long long sum=0;
for(int i=1;i<=n;i++){
cin>>x;
if(i==k) x-=x*2;
sum+=x;
}
cout<<sum;
return 0;
}
用循环要快很多!
这里空空如也








有帮助,赞一个