結果
| 問題 |
No.2155 みちらcolor
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-10 22:27:31 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 37 ms / 2,000 ms |
| コード長 | 881 bytes |
| コンパイル時間 | 1,183 ms |
| コンパイル使用メモリ | 114,392 KB |
| 最終ジャッジ日時 | 2025-02-24 17:23:07 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 64 |
ソースコード
#include<iostream>
#include<string>
#include<queue>
#include<vector>
#include<cassert>
#include<random>
#include<set>
#include<map>
#include<cassert>
#include<unordered_map>
#include<bitset>
#include<numeric>
#include<algorithm>
using namespace std;
typedef long long ll;
const int inf=1<<30;
const ll INF=1LL<<62;
typedef pair<int,ll> P;
typedef pair<int,P> PP;
const ll MOD=998244353;
bool dp[105][1000*100+5];
int main(){
int N,M,L;
cin>>N>>M>>L;
vector<int> A(N);
for(int i=0;i<N;i++){
cin>>A[i];
}
const int MAX=1000*100;
dp[0][L]=1;
for(int i=0;i<N;i++){
for(int c=0;c<=MAX;c++){
if(dp[i][c]){
int x=(c+A[i])/2;
dp[i+1][x]=1;
dp[i+1][c]=1;
}
}
}
if(dp[N][M]){
cout<<"Yes"<<endl;
}else{
cout<<"No"<<endl;
}
}