結果

問題 No.2131 Concon Substrings (COuNt Version)
ユーザー とりゐとりゐ
提出日時 2022-11-25 21:28:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 237 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 82,100 KB
実行使用メモリ 76,616 KB
最終ジャッジ日時 2024-04-10 02:39:00
合計ジャッジ時間 2,358 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,064 KB
testcase_01 AC 36 ms
51,760 KB
testcase_02 AC 33 ms
52,556 KB
testcase_03 AC 90 ms
76,360 KB
testcase_04 AC 33 ms
52,892 KB
testcase_05 AC 34 ms
52,684 KB
testcase_06 AC 33 ms
52,272 KB
testcase_07 AC 143 ms
76,276 KB
testcase_08 AC 75 ms
76,016 KB
testcase_09 AC 142 ms
76,616 KB
testcase_10 AC 140 ms
75,932 KB
testcase_11 AC 110 ms
76,116 KB
testcase_12 AC 109 ms
76,168 KB
testcase_13 AC 40 ms
59,032 KB
testcase_14 AC 77 ms
76,048 KB
testcase_15 AC 74 ms
75,860 KB
testcase_16 AC 41 ms
59,920 KB
testcase_17 AC 71 ms
76,044 KB
testcase_18 AC 71 ms
76,112 KB
testcase_19 AC 58 ms
76,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod=998244353

n=int(input())

dp=[0]*(n+1)
dp[0]=1
for i in range(n):
  ndp=[0]*(n+1)
  for j in range(n):
    ndp[j]+=dp[j]*25
    ndp[j+1]+=dp[j]
  dp=[i%mod for i in ndp]

ans=0
for i in range(n+1):
  ans+=dp[i]*(i//3)
print(ans%mod)
0