結果

問題 No.2155 みちらcolor
ユーザー Mazesoba
提出日時 2022-12-09 21:32:26
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 969 bytes
コンパイル時間 3,948 ms
コンパイル使用メモリ 251,672 KB
最終ジャッジ日時 2025-02-09 07:27:15
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 64
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <atcoder/all>
#include <bits/stdc++.h>

using namespace std;

//#define DISABLE_PRINT

#if defined(ENABLE_PRINT) && !defined(DISABLE_PRINT)

#define P(...) fprintf(stderr, __VA_ARGS__)
#define LP fprintf(stderr, "L: %d\n", __LINE__)

#else

#define P(...) ((void)0)
#define LP ((void)0)

#endif

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define ALL(x) x.begin(), x.end()

using ll = long long;
using ull = unsigned long long;

const int INF = 1100100100;
const ll INFLL = 1100100100100100100;

int main() {
    int N, M, L;
    cin >> N >> M >> L;
    using BS = bitset<1001>;
    BS dp;
    dp.set(L);
    rep(i, N) {
        int A;
        cin >> A;
        auto tdp = dp;
        rep(j, 1001) {
            if (!dp.test(j)) continue;
            auto to = (j + A) / 2;
            if (!(to >= 0 && to <= 1000)) continue;
            tdp.set(to);
        }
        dp = tdp;
    }
    cout << (dp.test(M) ? "Yes" : "No") << endl;
    return 0;
}
0