結果

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

ソースコード

diff #

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

bool f[1010][1010];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N,M,L;
    cin >> N >> M >> L;
    f[0][L] = true;
    for(int i = 0; i < N; i++) {
        int A;
        cin >> A;
        for(int j = 0; j <= 1000; j++) {
            if(!f[i][j]) continue;
            f[i+1][j] = true;
            f[i+1][(j+A)/2] = true;
        }
    }
    cout << ((f[N][M])?"Yes":"No") << endl;
}
0