제출 #1109296

#제출 시각아이디문제언어결과실행 시간메모리
1109296mariaclaraFoehn Phenomena (JOI17_foehn_phenomena)C++17
10 / 100
81 ms10596 KiB
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef tuple<ll,ll,ll> trio;
typedef pair<int,int> pii;
const int MAXN = 2e5+5;
const ll INF = 1e9;
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define mk make_pair
#define pb push_back
#define fr first
#define sc second

int n, q, s, t;
ll a[MAXN];
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    cin >> n >> q >> s >> t;

    for(int i = 0; i <= n; i++)
        cin >> a[i];

    while(q--) {
        int L, R, X;
        cin >> L >> R >> X;

        if(R == n) a[n] += X;
        
        if(a[n] < 0) cout << -a[n]*t << "\n";
        else cout << -a[n]*s << "\n";
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...