結果

問題 No.1304 あなたは基本が何か知っていますか?私は知っています.
ユーザー trineutrontrineutron
提出日時 2020-12-01 03:13:28
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 515 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 10,884 KB
実行使用メモリ 8,524 KB
最終ジャッジ日時 2023-09-03 03:14:47
合計ジャッジ時間 40,244 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
7,824 KB
testcase_01 AC 27 ms
7,908 KB
testcase_02 AC 17 ms
7,916 KB
testcase_03 WA -
testcase_04 AC 574 ms
8,300 KB
testcase_05 AC 268 ms
7,856 KB
testcase_06 AC 23 ms
7,904 KB
testcase_07 AC 475 ms
8,364 KB
testcase_08 WA -
testcase_09 AC 425 ms
8,280 KB
testcase_10 AC 338 ms
7,880 KB
testcase_11 AC 468 ms
8,288 KB
testcase_12 AC 365 ms
7,860 KB
testcase_13 AC 254 ms
7,852 KB
testcase_14 AC 310 ms
7,860 KB
testcase_15 AC 296 ms
7,896 KB
testcase_16 AC 354 ms
8,288 KB
testcase_17 AC 105 ms
7,896 KB
testcase_18 AC 329 ms
7,952 KB
testcase_19 AC 191 ms
7,896 KB
testcase_20 AC 45 ms
7,900 KB
testcase_21 AC 250 ms
8,252 KB
testcase_22 AC 374 ms
8,324 KB
testcase_23 AC 449 ms
8,292 KB
testcase_24 AC 583 ms
8,288 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 31 ms
8,228 KB
testcase_31 AC 48 ms
8,252 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 26 ms
8,344 KB
testcase_39 AC 34 ms
8,336 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
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 34 ms
12,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353

n, k, x, y = map(int, input().split())
a = set(map(int, input().split()))
k = len(a)
x = min(x, 1024)
y = min(y, 1023)

dp = [[0] * 1024 for i in range(n + 1)]
dp[0][0] = 1
for i in range(n):
    for prev in range(1024):
        for item in a:
            dp[i + 1][item ^ prev] += dp[i][prev]
        if i > 0:
            dp[i + 1][prev] -= k * dp[i - 1][prev]
        if i > 1:
            for item in a:
                dp[i + 1][prev] += dp[i - 2][item ^ prev]

print(sum(dp[n][x:y+1]) % mod)
0