結果
問題 |
No.2155 みちらcolor
|
ユーザー |
|
提出日時 | 2022-12-14 12:41:09 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 1,770 bytes |
コンパイル時間 | 1,742 ms |
コンパイル使用メモリ | 174,804 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-08 04:06:51 |
合計ジャッジ時間 | 3,598 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 64 |
ソースコード
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using uint = unsigned; using pii = pair<int, int>; using pll = pair<ll, ll>; template<class T> using pq = priority_queue<T, vector<T>, greater<T>>; const int MOD = 1000000007; const int MODD = 998244353; const ll dx[] = {0, 1, 0, -1, 1, -1, 1, -1}; const ll dy[] = {1, 0, -1, 0, 1, 1, -1, -1}; #define overload4(_1, _2, _3, _4, name, ...) name #define overload3(_1, _2, _3, name, ...) name #define rep1(n) for(ll i = 0; i < (ll)(n); i++) #define rep2(i, n) for(ll i = 0; i < (ll)(n); i++) #define rep3(i, a, b) for(ll i = (ll)(a); i < (ll)(b); i++) #define rep4(i, a, b, c) for(ll i = (ll)(a); i < (ll)(b); i += (ll)(c)) #define rep(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__) #define rrep1(n) for(ll i = (ll)(n); i > (ll)(0); i--) #define rrep2(i, n) for(ll i = (ll)(n); i > (ll)(0); i--) #define rrep3(i, a, b) for(ll i = (ll)(a); i > (ll)(b); i--) #define rrep4(i, a, b, c) for(ll i = (ll)(a); i > (ll)(b); i -= (ll)(c)) #define rrep(...) overload4(__VA_ARGS__, rrep4, rrep3, rrep2, rrep1)(__VA_ARGS__) #define all(v) v.begin(), v.end() #define elif else if #define eb emplace_back #define mp make_pair #define mt make_tuple #define fi first #define se second #define stoi stoll #define MIN(v) *min_element(all(v)) #define MAX(v) *max_element(all(v)) int main(){ ll N, M, L; cin >> N >> M >> L; vector<ll> A(N); rep(N) cin >> A[i]; vector<vector<bool>> dp(110, vector<bool>(1100, false)); dp[0][L] = true; rep(i, N)rep(j, 1, 1001){ if(dp[i][j] == false) continue; dp[i+1][j] = dp[i+1][(j+A[i])/2] = true; } cout << (dp[N][M] ? "Yes" : "No") << endl; return 0; }