結果

問題 No.2131 Concon Substrings (COuNt Version)
ユーザー titiatitia
提出日時 2022-11-25 22:36:43
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 178 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 1,034 ms
コンパイル使用メモリ 86,932 KB
実行使用メモリ 77,496 KB
最終ジャッジ日時 2023-07-25 10:47:47
合計ジャッジ時間 3,767 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
70,912 KB
testcase_01 AC 75 ms
71,428 KB
testcase_02 AC 78 ms
71,064 KB
testcase_03 AC 129 ms
77,216 KB
testcase_04 AC 74 ms
71,240 KB
testcase_05 AC 74 ms
71,392 KB
testcase_06 AC 74 ms
71,028 KB
testcase_07 AC 178 ms
77,496 KB
testcase_08 AC 111 ms
77,208 KB
testcase_09 AC 178 ms
77,492 KB
testcase_10 AC 178 ms
77,320 KB
testcase_11 AC 149 ms
77,032 KB
testcase_12 AC 147 ms
76,980 KB
testcase_13 AC 80 ms
76,392 KB
testcase_14 AC 115 ms
77,164 KB
testcase_15 AC 110 ms
77,076 KB
testcase_16 AC 80 ms
76,064 KB
testcase_17 AC 106 ms
76,984 KB
testcase_18 AC 108 ms
77,184 KB
testcase_19 AC 92 ms
76,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
mod=998244353

DP=[0]*(N+2)
DP[0]=1

for i in range(N):
    NDP=[0]*(N+2)
    for j in range(N+1):
        x=DP[j]
        NDP[j+1]+=x
        NDP[j]+=x*25

    DP=[ndp%mod for ndp in NDP]

ANS=0

for i in range(N+2):
    ANS+=DP[i]*(i//3)
    ANS%=mod

print(ANS)
0