結果
問題 |
No.2155 みちらcolor
|
ユーザー |
👑 ![]() |
提出日時 | 2022-12-10 00:21:54 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 556 bytes |
コンパイル時間 | 2,104 ms |
コンパイル使用メモリ | 196,136 KB |
最終ジャッジ日時 | 2025-02-09 08:59:01 |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 64 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i=a;i<b;i++) using ll = long long; template<class T> bool chmin(T &a,const T b){if(a>b){a=b;return 1;}return 0;} template<class T> bool chmax(T &a,const T b){if(a<b){a=b;return 1;}return 0;} const int INF = (1<<30)-1; #define all(p) p.begin(),p.end() int main(){ int N,M,L; cin>>N>>M>>L; int D=1010; vector<bool> dp(D); dp[L]=1; rep(i,0,N){ int a; cin>>a; auto ndp=dp; rep(j,0,D){ if(dp[j]) ndp[(j+a)/2]=1; } swap(ndp,dp); } cout<<(dp[M] ? "Yes\n" : "No\n"); }