Submission #685903

#TimeUsernameProblemLanguageResultExecution timeMemory
685903zeroesandonesFoehn Phenomena (JOI17_foehn_phenomena)C++17
10 / 100
97 ms10564 KiB
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef long double ld; typedef vector<ll> vi; typedef pair<ll, ll> pi; #define FOR(i, j, k) for (ll i = j; i < (ll) k; ++i) #define FORD(i, j, k) for (ll i = j; i >= (ll) k; --i) #define nl "\n" #define sp " " #define all(x) (x).begin(), (x).end() #define sc second #define fr first #define pb emplace_back void solve() { ll n, q, s, t; cin >> n >> q >> s >> t; ll a[n + 1]; FOR(i, 0, n + 1) cin >> a[i]; auto calc = [&]() { return (a[0] - a[n]) * s; }; while(q--) { int l, r, v; cin >> l >> r >> v; if(r == n) a[r] += v; cout << calc() << nl; } } signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll t = 1; // cin >> t; while (t--) { solve(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...