結果

問題 No.1304 あなたは基本が何か知っていますか?私は知っています.
ユーザー trineutrontrineutron
提出日時 2020-12-01 03:20:44
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 1,929 ms / 2,000 ms
コード長 476 bytes
コンパイル時間 711 ms
コンパイル使用メモリ 10,892 KB
実行使用メモリ 8,380 KB
最終ジャッジ日時 2023-09-03 03:15:48
合計ジャッジ時間 56,466 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
7,756 KB
testcase_01 AC 41 ms
7,880 KB
testcase_02 AC 19 ms
7,856 KB
testcase_03 AC 269 ms
8,380 KB
testcase_04 AC 1,929 ms
8,348 KB
testcase_05 AC 897 ms
7,808 KB
testcase_06 AC 34 ms
7,812 KB
testcase_07 AC 1,594 ms
8,284 KB
testcase_08 AC 258 ms
8,300 KB
testcase_09 AC 1,440 ms
8,216 KB
testcase_10 AC 1,155 ms
7,876 KB
testcase_11 AC 1,520 ms
8,288 KB
testcase_12 AC 1,274 ms
8,224 KB
testcase_13 AC 838 ms
7,896 KB
testcase_14 AC 1,045 ms
7,800 KB
testcase_15 AC 1,025 ms
7,772 KB
testcase_16 AC 1,162 ms
7,808 KB
testcase_17 AC 274 ms
7,756 KB
testcase_18 AC 1,135 ms
7,776 KB
testcase_19 AC 596 ms
7,828 KB
testcase_20 AC 109 ms
7,788 KB
testcase_21 AC 676 ms
8,184 KB
testcase_22 AC 1,303 ms
8,188 KB
testcase_23 AC 1,541 ms
8,268 KB
testcase_24 AC 1,884 ms
8,232 KB
testcase_25 AC 147 ms
8,164 KB
testcase_26 AC 229 ms
8,300 KB
testcase_27 AC 314 ms
8,260 KB
testcase_28 AC 183 ms
8,232 KB
testcase_29 AC 166 ms
8,360 KB
testcase_30 AC 55 ms
8,312 KB
testcase_31 AC 142 ms
8,248 KB
testcase_32 AC 341 ms
8,240 KB
testcase_33 AC 143 ms
8,292 KB
testcase_34 AC 310 ms
8,348 KB
testcase_35 AC 148 ms
8,224 KB
testcase_36 AC 146 ms
8,204 KB
testcase_37 AC 133 ms
8,288 KB
testcase_38 AC 37 ms
8,152 KB
testcase_39 AC 67 ms
8,324 KB
testcase_40 AC 151 ms
8,304 KB
testcase_41 AC 120 ms
8,332 KB
testcase_42 AC 175 ms
8,216 KB
testcase_43 AC 149 ms
8,168 KB
testcase_44 AC 154 ms
8,192 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 19 ms
7,880 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