結果

問題 No.1304 あなたは基本が何か知っていますか?私は知っています.
ユーザー trineutrontrineutron
提出日時 2020-12-01 03:21:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 476 bytes
コンパイル時間 668 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 77,748 KB
最終ジャッジ日時 2023-09-03 03:15:02
合計ジャッジ時間 14,885 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
76,804 KB
testcase_01 AC 106 ms
77,304 KB
testcase_02 AC 81 ms
76,608 KB
testcase_03 AC 119 ms
77,748 KB
testcase_04 AC 124 ms
76,416 KB
testcase_05 AC 109 ms
76,812 KB
testcase_06 AC 101 ms
76,912 KB
testcase_07 AC 118 ms
76,876 KB
testcase_08 AC 116 ms
77,532 KB
testcase_09 AC 115 ms
76,592 KB
testcase_10 AC 112 ms
76,708 KB
testcase_11 AC 119 ms
76,880 KB
testcase_12 AC 112 ms
76,928 KB
testcase_13 AC 108 ms
76,564 KB
testcase_14 AC 111 ms
76,812 KB
testcase_15 AC 110 ms
76,884 KB
testcase_16 AC 113 ms
76,560 KB
testcase_17 AC 120 ms
77,460 KB
testcase_18 AC 115 ms
76,368 KB
testcase_19 AC 107 ms
76,368 KB
testcase_20 AC 100 ms
76,536 KB
testcase_21 AC 129 ms
77,264 KB
testcase_22 AC 116 ms
76,680 KB
testcase_23 AC 116 ms
76,800 KB
testcase_24 AC 123 ms
76,564 KB
testcase_25 AC 116 ms
77,492 KB
testcase_26 AC 115 ms
77,552 KB
testcase_27 AC 121 ms
77,476 KB
testcase_28 AC 111 ms
77,540 KB
testcase_29 AC 110 ms
77,520 KB
testcase_30 AC 107 ms
77,532 KB
testcase_31 AC 109 ms
77,520 KB
testcase_32 AC 114 ms
77,584 KB
testcase_33 AC 114 ms
77,520 KB
testcase_34 AC 120 ms
77,452 KB
testcase_35 AC 115 ms
77,484 KB
testcase_36 AC 117 ms
77,472 KB
testcase_37 AC 110 ms
77,560 KB
testcase_38 AC 97 ms
76,820 KB
testcase_39 AC 93 ms
76,804 KB
testcase_40 AC 111 ms
77,432 KB
testcase_41 AC 111 ms
77,452 KB
testcase_42 AC 114 ms
77,472 KB
testcase_43 AC 117 ms
77,164 KB
testcase_44 AC 116 ms
77,420 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 RE -
06_evil_C_02 RE -
06_evil_C_03 RE -
06_evil_C_04 RE -
06_evil_C_05 RE -
06_evil_C_06 RE -
06_evil_C_07 RE -
06_evil_C_08 RE -
06_evil_C_09 RE -
06_evil_C_10 AC 75 ms
71,440 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:
            for j in range(i, -1, -2):
                dp[i + 1][prev] += dp[j][item ^ prev]
            for j in range(i - 1, -1, -2):
                dp[i + 1][prev] -= dp[j][prev]

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