結果

問題 No.2155 みちらcolor
ユーザー ripityripity
提出日時 2022-12-09 22:00:38
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 194 ms / 2,000 ms
コード長 684 bytes
コンパイル時間 2,686 ms
コンパイル使用メモリ 220,724 KB
実行使用メモリ 11,112 KB
最終ジャッジ日時 2024-04-27 04:20:38
合計ジャッジ時間 11,012 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 178 ms
11,112 KB
testcase_01 AC 120 ms
11,036 KB
testcase_02 AC 92 ms
10,868 KB
testcase_03 AC 111 ms
10,896 KB
testcase_04 AC 123 ms
11,088 KB
testcase_05 AC 163 ms
11,044 KB
testcase_06 AC 66 ms
10,984 KB
testcase_07 AC 47 ms
11,012 KB
testcase_08 AC 119 ms
11,036 KB
testcase_09 AC 132 ms
10,928 KB
testcase_10 AC 87 ms
11,056 KB
testcase_11 AC 84 ms
10,896 KB
testcase_12 AC 136 ms
11,004 KB
testcase_13 AC 15 ms
10,988 KB
testcase_14 AC 140 ms
11,048 KB
testcase_15 AC 22 ms
10,860 KB
testcase_16 AC 79 ms
10,956 KB
testcase_17 AC 34 ms
10,892 KB
testcase_18 AC 125 ms
10,996 KB
testcase_19 AC 139 ms
11,044 KB
testcase_20 AC 169 ms
11,024 KB
testcase_21 AC 192 ms
11,084 KB
testcase_22 AC 144 ms
11,036 KB
testcase_23 AC 150 ms
10,992 KB
testcase_24 AC 184 ms
11,008 KB
testcase_25 AC 175 ms
11,048 KB
testcase_26 AC 165 ms
11,076 KB
testcase_27 AC 180 ms
11,040 KB
testcase_28 AC 161 ms
10,928 KB
testcase_29 AC 164 ms
11,072 KB
testcase_30 AC 153 ms
11,008 KB
testcase_31 AC 172 ms
11,024 KB
testcase_32 AC 179 ms
10,900 KB
testcase_33 AC 186 ms
10,960 KB
testcase_34 AC 185 ms
11,068 KB
testcase_35 AC 170 ms
11,068 KB
testcase_36 AC 183 ms
11,032 KB
testcase_37 AC 194 ms
11,008 KB
testcase_38 AC 164 ms
10,996 KB
testcase_39 AC 191 ms
11,064 KB
testcase_40 AC 194 ms
11,032 KB
testcase_41 AC 191 ms
11,052 KB
testcase_42 AC 191 ms
11,036 KB
testcase_43 AC 22 ms
10,960 KB
testcase_44 AC 14 ms
10,928 KB
testcase_45 AC 13 ms
11,020 KB
testcase_46 AC 6 ms
11,064 KB
testcase_47 AC 37 ms
10,992 KB
testcase_48 AC 36 ms
11,100 KB
testcase_49 AC 13 ms
10,984 KB
testcase_50 AC 35 ms
11,092 KB
testcase_51 AC 34 ms
11,068 KB
testcase_52 AC 33 ms
11,000 KB
testcase_53 AC 37 ms
10,928 KB
testcase_54 AC 30 ms
11,024 KB
testcase_55 AC 13 ms
10,856 KB
testcase_56 AC 35 ms
10,928 KB
testcase_57 AC 25 ms
11,088 KB
testcase_58 AC 24 ms
11,000 KB
testcase_59 AC 16 ms
10,984 KB
testcase_60 AC 16 ms
10,928 KB
testcase_61 AC 24 ms
10,896 KB
testcase_62 AC 33 ms
10,892 KB
testcase_63 AC 27 ms
11,020 KB
testcase_64 AC 26 ms
11,068 KB
testcase_65 AC 14 ms
11,036 KB
testcase_66 AC 26 ms
10,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, M, L;
    cin >> N >> M >> L;
    vector<int> A(N);
    for( int i = 0; i < N; i++ ) {
        cin >> A[i];
    }
    int K = 1000005;
    vector<int> dp1(K), dp2(K);
    dp1[min(K-1, L)] = 1;
    for( int i = 0; i < N; i++ ) {
        for( int l = 0; l < K; l++ ) {
            dp2[l] |= dp1[l];
            dp2[min(K-1, (l+A[i])/2)] |= dp1[l];
        }
        swap(dp1, dp2);
        fill(dp2.begin(), dp2.end(), 0);
    }
    cout << ( dp1[M] ? "Yes" : "No" ) << endl;
}
0