题目如下:
F-这是一道大水题
代码如下:
#include<iostream>
using namespace std;
int main(){
long long m,n,sum=0;
int flag;
cin>>n>>m;
long long movie[n+1]={0};
while(m--){
cin>>flag;
if(flag==0){
long long l,r,z;
cin>>l>>r>>z;
long long count=r-l+1;
sum+=count*z;
for(long long i=l;i<=r;i++){
movie[i]+=count*z;
}
}else if(flag==1){
long long ex;
cin>>ex;
cout<<sum-movie[ex]<<endl;
}
}
return 0;
}