提交时间:2023-11-21 21:43:20
运行 ID: 31719
#include<bits/stdc++.h> using namespace std; int a[205],b[205],n,m; int main(){ cin>>n>>m; for(int i=1;i<=n;i++) cin>>a[i]; while(m){ int x,y,z; cin>>x>>y>>z; b[x]+=z; b[y+1]-=z; m--; } for(int i=1;i<=n;i++){ b[i]+=b[i-1]; a[i]+=b[i]; cout<<a[i]<<" "; } return 0; }