結果

問題 No.2155 みちらcolor
ユーザー ruthen71ruthen71
提出日時 2022-12-10 16:48:23
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 594 bytes
コンパイル時間 2,641 ms
コンパイル使用メモリ 203,268 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-14 23:47:14
合計ジャッジ時間 4,273 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 64
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#ifdef _RUTHEN
#include <debug.hpp>
#else
#define show(...) true
#endif

using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
template <class T> using V = vector<T>;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N, M, L;
    cin >> N >> M >> L;
    V<int> A(N);
    rep(i, N) cin >> A[i];
    V<int> dp(1001, 0);
    dp[L] = 1;
    rep(i, N) {
        V<int> np = dp;
        rep(j, 1001) np[(j + A[i]) / 2] |= dp[j];
        swap(dp, np);
    }
    cout << (dp[M] ? "Yes" : "No") << '\n';
    return 0;
}
0