結果

問題 No.2155 みちらcolor
ユーザー yansi819
提出日時 2024-04-11 20:17:05
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 22 ms / 2,000 ms
コード長 576 bytes
コンパイル時間 4,677 ms
コンパイル使用メモリ 254,204 KB
最終ジャッジ日時 2025-02-20 23:55:43
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 64
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
using mint = modint998244353;

int main() {
  int N, M, L; cin >> N >> M >> L;
  vector<int> A(N);
  for (auto &x: A) cin >> x;
  vector<vector<bool>> dp(N + 1, vector<bool>(1001, false));
  dp[0][L] = true;
  for (int i = 1; i <= N; i++) {
    for (int j = 0; j <= 1000; j++) {
      if (dp[i - 1][j]) {
        dp[i][j] = true;
        dp[i][(j + A[i - 1]) / 2] = true;
      }
    }
  }
  cout << (dp[N][M] ? "Yes": "No") << endl; 
}
0