結果

問題 No.1304 あなたは基本が何か知っていますか?私は知っています.
ユーザー face4face4
提出日時 2020-12-05 11:28:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 152 ms / 2,000 ms
コード長 1,059 bytes
コンパイル時間 785 ms
コンパイル使用メモリ 76,924 KB
実行使用メモリ 23,096 KB
最終ジャッジ日時 2023-09-03 04:05:30
合計ジャッジ時間 36,946 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
16,244 KB
testcase_01 AC 30 ms
23,036 KB
testcase_02 AC 20 ms
18,780 KB
testcase_03 AC 152 ms
16,276 KB
testcase_04 AC 50 ms
22,996 KB
testcase_05 AC 24 ms
15,936 KB
testcase_06 AC 18 ms
23,068 KB
testcase_07 AC 38 ms
15,996 KB
testcase_08 AC 39 ms
23,096 KB
testcase_09 AC 33 ms
15,980 KB
testcase_10 AC 27 ms
16,264 KB
testcase_11 AC 34 ms
19,044 KB
testcase_12 AC 28 ms
18,664 KB
testcase_13 AC 26 ms
15,988 KB
testcase_14 AC 28 ms
18,864 KB
testcase_15 AC 26 ms
16,212 KB
testcase_16 AC 28 ms
16,132 KB
testcase_17 AC 29 ms
11,756 KB
testcase_18 AC 28 ms
11,556 KB
testcase_19 AC 22 ms
11,620 KB
testcase_20 AC 20 ms
11,872 KB
testcase_21 AC 29 ms
11,632 KB
testcase_22 AC 28 ms
11,568 KB
testcase_23 AC 33 ms
11,568 KB
testcase_24 AC 50 ms
11,572 KB
testcase_25 AC 69 ms
11,620 KB
testcase_26 AC 38 ms
11,624 KB
testcase_27 AC 39 ms
11,568 KB
testcase_28 AC 52 ms
11,628 KB
testcase_29 AC 39 ms
11,616 KB
testcase_30 AC 62 ms
11,660 KB
testcase_31 AC 87 ms
11,592 KB
testcase_32 AC 40 ms
11,624 KB
testcase_33 AC 70 ms
11,608 KB
testcase_34 AC 40 ms
11,600 KB
testcase_35 AC 58 ms
11,748 KB
testcase_36 AC 80 ms
11,560 KB
testcase_37 AC 60 ms
11,632 KB
testcase_38 AC 59 ms
11,672 KB
testcase_39 AC 100 ms
11,660 KB
testcase_40 AC 60 ms
11,624 KB
testcase_41 AC 97 ms
11,556 KB
testcase_42 AC 58 ms
11,564 KB
testcase_43 AC 57 ms
11,564 KB
testcase_44 AC 82 ms
11,628 KB
04_evil_A_01 RE -
04_evil_A_02 RE -
04_evil_A_03 RE -
04_evil_A_04 RE -
04_evil_A_05 RE -
04_evil_A_06 RE -
04_evil_A_07 RE -
04_evil_A_08 RE -
04_evil_A_09 RE -
04_evil_A_10 RE -
05_evil_B_01 RE -
05_evil_B_02 RE -
05_evil_B_03 RE -
05_evil_B_04 RE -
05_evil_B_05 RE -
05_evil_B_06 RE -
05_evil_B_07 RE -
05_evil_B_08 RE -
05_evil_B_09 RE -
05_evil_B_10 RE -
06_evil_C_01 TLE -
06_evil_C_02 TLE -
06_evil_C_03 TLE -
06_evil_C_04 TLE -
06_evil_C_05 TLE -
06_evil_C_06 TLE -
06_evil_C_07 TLE -
06_evil_C_08 TLE -
06_evil_C_09 TLE -
06_evil_C_10 AC 14 ms
16,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
using namespace std;
typedef long long ll;
const ll mod = 998244353;

int dp[2][1<<10][1<<10] = {};

int main(){
    int n, k, x, y;
    cin >> n >> k >> x >> y;
    vector<int> v;
    for(int i = 0; i < k; i++){
        int a;
        cin >> a;
        v.push_back(a);
    }
    sort(v.begin(), v.end());
    v.erase(unique(v.begin(), v.end()), v.end());
    ll sum[1<<10] = {};
    sum[0] = 1;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < 1<<10; j++){
            for(int t : v){
                dp[1][t][j] = sum[t^j]-dp[0][t][t^j];
            }
        }
        swap(dp[0], dp[1]);
        memset(dp[1], 0, sizeof(dp[1]));
        for(int j = 0; j < 1<<10; j++){
            sum[j] = 0;
            for(int l = 0; l < 1<<10; l++){
                sum[j] += dp[0][l][j];
            }
            sum[j] %= mod;
        }
    }
    ll ans = 0;
    for(int i = x; i <= min(1023, y); i++){
        (ans += sum[i]) %= mod;
    }
    cout << ans << endl;
    return 0;
}
0