結果

問題 No.1353 Limited Sequence
ユーザー titiatitia
提出日時 2021-09-02 00:34:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 896 ms / 2,000 ms
コード長 591 bytes
コンパイル時間 860 ms
コンパイル使用メモリ 86,896 KB
実行使用メモリ 109,660 KB
最終ジャッジ日時 2023-08-19 07:42:35
合計ジャッジ時間 19,583 ms
ジャッジサーバーID
(参考情報)
judge15 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,372 KB
testcase_01 AC 81 ms
76,612 KB
testcase_02 AC 92 ms
76,728 KB
testcase_03 AC 77 ms
76,316 KB
testcase_04 AC 79 ms
76,364 KB
testcase_05 AC 88 ms
76,676 KB
testcase_06 AC 85 ms
76,608 KB
testcase_07 AC 89 ms
76,636 KB
testcase_08 AC 85 ms
76,724 KB
testcase_09 AC 87 ms
76,716 KB
testcase_10 AC 86 ms
76,440 KB
testcase_11 AC 85 ms
76,756 KB
testcase_12 AC 395 ms
90,652 KB
testcase_13 AC 455 ms
86,572 KB
testcase_14 AC 154 ms
86,216 KB
testcase_15 AC 325 ms
94,528 KB
testcase_16 AC 106 ms
79,564 KB
testcase_17 AC 131 ms
83,104 KB
testcase_18 AC 385 ms
90,748 KB
testcase_19 AC 595 ms
101,560 KB
testcase_20 AC 185 ms
85,204 KB
testcase_21 AC 116 ms
78,540 KB
testcase_22 AC 128 ms
81,300 KB
testcase_23 AC 444 ms
89,028 KB
testcase_24 AC 308 ms
85,452 KB
testcase_25 AC 521 ms
97,012 KB
testcase_26 AC 279 ms
86,096 KB
testcase_27 AC 182 ms
81,152 KB
testcase_28 AC 183 ms
87,568 KB
testcase_29 AC 166 ms
79,516 KB
testcase_30 AC 392 ms
83,952 KB
testcase_31 AC 250 ms
83,972 KB
testcase_32 AC 155 ms
89,968 KB
testcase_33 AC 102 ms
76,988 KB
testcase_34 AC 181 ms
91,104 KB
testcase_35 AC 112 ms
76,776 KB
testcase_36 AC 111 ms
76,876 KB
testcase_37 AC 839 ms
109,660 KB
testcase_38 AC 862 ms
109,228 KB
testcase_39 AC 873 ms
109,220 KB
testcase_40 AC 885 ms
109,296 KB
testcase_41 AC 876 ms
109,384 KB
testcase_42 AC 832 ms
109,232 KB
testcase_43 AC 814 ms
109,288 KB
testcase_44 AC 868 ms
109,132 KB
testcase_45 AC 701 ms
109,164 KB
testcase_46 AC 896 ms
109,260 KB
testcase_47 AC 238 ms
109,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N,L,R=map(int,input().split())
A=list(map(int,input().split()))
mod=998244353

DP=[[0]*(N+1) for i in range(R+1)]
S=[0]*(R+1)

#for i in range(R+1):
#    DP[0][i]=1
S[0]=1

for i in range(1,R+1):
    for j in range(N+1):
        for t in range(1,R+1):
            if t>=A[j-1]+1:
                break
            if i-t*j<0:
                break
            
            DP[i][j]+=S[i-t*j]-DP[i-t*j][j]
            DP[i][j]%=mod

        S[i]+=DP[i][j]
        S[i]%=mod

ANS=0
for i in range(L,R+1):
    ANS+=sum(DP[i])%mod
    ANS%=mod

print(ANS)
0