제출 #1354081

#제출 시각아이디문제언어결과실행 시간메모리
1354081bimmerFoehn Phenomena (JOI17_foehn_phenomena)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#include "algo/debug.h"
#endif
using namespace std;
#define int long long 
#define endl '\n'
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

const int sz = 2e5 + 5, inf = 1e9, mod = 1e9 + 7;

int a[sz], d[sz], n, q, s, t;

int cost(int x){
    if (x > 0) return -s * x;
    return -t * x;
}

void _(){ 
    cin >> n >> q >> s >> t;
    for (int i = 0; i <= n; i++) {
        cin >> a[i];
    }
    int ans = 0;
    for (int i = 1; i <= n; i++) {
        d[i] = a[i] - a[i - 1];
        ans += cost(d[i]);
    }
    while (q--) {
        int l, r, x;
        cin >> l >> r >> x;
        ans -= cost(d[l]);
        d[l] += x;
        ans += cost(d[l]);
        if (r + 1 <= n) {
            ans -= cost(d[r + 1]);
            d[r + 1] -= x;
            ans += cost(d[r + 1]);
        }
        cout << ans << endl;
    }
}

signed main(){
    cin.tie(nullptr)->sync_with_stdio(0);
    int T = 1;
    // cin >> T;
    while (T--) _();
}
// By Riyad

컴파일 시 표준 에러 (stderr) 메시지

foehn_phenomena.cpp:3:10: fatal error: algo/debug.h: No such file or directory
    3 | #include "algo/debug.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.