제출 #1357592

#제출 시각아이디문제언어결과실행 시간메모리
1357592Ekber_EkberHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
    #include <debug.h>
#else
    #define debug(...)
#endif
#define GOOD_LUCK ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define int long long
#define endl "\n"
#define ff first
#define ss second
#define pb push_back
#define all(v) v.begin(), v.end()
using namespace std;

constexpr int MAX = 2e+5 + 1, INF = 2e+16, MOD = 1e+9 + 7, K = 31;

void _() {
    int n, q;
    cin >> n >> q;
    vector <int> v(n);
    for (int &i : v) cin >> i;
    while (q--) {
        int l, r, k;
        cin >> l >> r >> k;
        --l, --r;
        vector <int> a(v.begin() + l, v.begin() + r);
        sort(all(a));
        for (int i = r; i >= l; i--) {
            if (a[i] == v[i]) r--;
        }
        if (l > r) {
            cout << "1\n";
            continue;
        }
        int id = max_element(v.begin() + l, v.begin() + r) - v.begin();
        bool ok = 1;
        for (int i = id + 1; i <= r; i++) {
            if (v[i] + v[id] >= k) ok = 0;
        }
        if (ok) cout << "1\n";
        else cout << "0\n";
    }
}

signed main() {

    GOOD_LUCK

    int tests=1;
    // cin >> tests;
    for (int i=1; i <= tests; i++) {
        _();
        cout << endl;
    }

    return 0;
}

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

sortbooks.cpp:3:14: fatal error: debug.h: No such file or directory
    3 |     #include <debug.h>
      |              ^~~~~~~~~
compilation terminated.