This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int v[maxn];
int main(){
int n, q, s, t; cin >> n >> q >> s >> t;
for(int i = 0; i <= n; i++) cin >> v[i];
long long ans = v[n];
while(q--){
int l, r, x; cin >> l >> r >> x;
if(r==n) ans -= x;
cout << ans*t << '\n';
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |