結果

問題 No.2131 Concon Substrings (COuNt Version)
ユーザー titiatitia
提出日時 2022-11-25 22:36:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 318 ms
コンパイル使用メモリ 82,452 KB
実行使用メモリ 76,412 KB
最終ジャッジ日時 2024-04-10 03:47:57
合計ジャッジ時間 2,696 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,944 KB
testcase_01 AC 35 ms
51,876 KB
testcase_02 AC 34 ms
52,812 KB
testcase_03 AC 90 ms
76,364 KB
testcase_04 AC 36 ms
52,312 KB
testcase_05 AC 35 ms
52,216 KB
testcase_06 AC 37 ms
51,824 KB
testcase_07 AC 139 ms
76,264 KB
testcase_08 AC 75 ms
76,164 KB
testcase_09 AC 139 ms
76,376 KB
testcase_10 AC 141 ms
76,412 KB
testcase_11 AC 116 ms
76,076 KB
testcase_12 AC 113 ms
76,212 KB
testcase_13 AC 44 ms
62,048 KB
testcase_14 AC 80 ms
76,012 KB
testcase_15 AC 76 ms
76,220 KB
testcase_16 AC 42 ms
59,896 KB
testcase_17 AC 70 ms
76,152 KB
testcase_18 AC 72 ms
76,168 KB
testcase_19 AC 57 ms
76,072 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