提交时间:2024-01-21 11:56:39

运行 ID: 37516

#include <bits/stdc++.h> using namespace std; int a[260], b[260]; int main(){ int n, m; cin >> n >> m; for (int i = 1; i <= n; ++ i) cin >> a[i]; while (m--){ int l, r, c; b[l] += c; b[r + 1] -= c; } for (int i = 1; i <= n; ++ i){ a[i] = b[i] + a[i - 1]; a[i] += b[i]; cout << a[i] << " "; } return 0; }