来自可莉厨的尖锐叫声(开溜!!!)
2024-08-17 16:30:30
发布于:上海
5阅读
0回复
0点赞
#include<iostream>
using namespace std;
const int N=1e5+5;
int DUDUKE[N];
int HONGLONG[N];
int main(){
int ILOVEKELI,IloveU;
cin>>ILOVEKELI>>IloveU;
for(int BENG=1;BENG<=ILOVEKELI;BENG++){
cin>>DUDUKE[BENG];
}
HONGLONG[1]=DUDUKE[1];
for(int BENG=2;BENG<=ILOVEKELI;BENG++){
HONGLONG[BENG]=HONGLONG[BENG-1]+DUDUKE[BENG];
}
for(int BENG=1;BENG<=IloveU;BENG++){
int HUOHUA,QISHI;
cin>>HUOHUA>>QISHI;
cout<<HONGLONG[QISHI]-HONGLONG[HUOHUA-1]<<endl;
}
}
这里空空如也
有帮助,赞一个