結果

問題 No.2131 Concon Substrings (COuNt Version)
ユーザー 👑 timitimi
提出日時 2022-11-27 18:00:37
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 77,332 KB
最終ジャッジ日時 2023-07-27 12:53:34
合計ジャッジ時間 3,394 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,420 KB
testcase_01 AC 77 ms
71,088 KB
testcase_02 AC 78 ms
71,352 KB
testcase_03 AC 101 ms
77,048 KB
testcase_04 AC 78 ms
71,568 KB
testcase_05 AC 76 ms
71,384 KB
testcase_06 AC 75 ms
71,252 KB
testcase_07 AC 121 ms
77,172 KB
testcase_08 AC 96 ms
76,712 KB
testcase_09 AC 122 ms
76,780 KB
testcase_10 AC 121 ms
77,332 KB
testcase_11 AC 111 ms
77,004 KB
testcase_12 AC 112 ms
76,704 KB
testcase_13 AC 81 ms
76,028 KB
testcase_14 AC 98 ms
76,964 KB
testcase_15 AC 95 ms
76,976 KB
testcase_16 AC 82 ms
76,024 KB
testcase_17 AC 96 ms
76,976 KB
testcase_18 AC 94 ms
77,004 KB
testcase_19 AC 87 ms
76,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
mod=998244353
dp=[0]*(N+10)
dp[0]=1
for i in range(N):
  ndp=[0]*(N+2)
  for j in range(i+2):
    ndp[j]=25*dp[j]+dp[j-1]
    ndp[j]%=mod
  dp=ndp
ans=0
for i in range(N+1):
  ans += dp[i] * (i//3)
  ans%=mod
print(ans)
0