제출 #1368894

#제출 시각아이디문제언어결과실행 시간메모리
1368894Ekber_Ekber은행 (IZhO14_bank)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, m;
    cin >> n >> m;
    vector <int> a(n), b(m);
    for (int &i : a) cin >> i;
    for (int &i : b) cin >> i;
    vector <vector <int>> can(n);
    for (int i = 0; i < n; i++) {
        for (int mask = 0; mask < (1LL << m); mask++) {
            int sum = 0;
            for (int j = 0; j < m; j++) {
                if (mask & (1LL << j)) sum += b[j];
            }
            if (sum == a[i]) can[i].pb(mask);
        }
    }
    debug(can);
    vector <int> dp((1LL << m), -1);
    dp[0] = 0;
    for (int i = 0; i < (1LL << m); i++) {
        if (dp[i] < 0 || dp[i] >= n) continue;
        int x = dp[i];
        for (int &j : can[x]) {
            if (i + j >= (1LL << m)) continue;
            if (i + j == (i | j)) dp[i + j] = max(dp[i+j], x+1);
        }
    }
    for (int i = 0; i < (1 << m); i++) {
        if (dp[i] == n) {
            cout << "YES";
            return;
        }
    }
    cout << "NO";
}

signed main() {

    GOOD_LUCK

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

    return 0;
}

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

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