結果

問題 No.2131 Concon Substrings (COuNt Version)
ユーザー hir355hir355
提出日時 2022-11-26 00:17:36
言語 PyPy3
(7.3.13)
結果
WA  
実行時間 -
コード長 302 bytes
コンパイル時間 461 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 137,524 KB
最終ジャッジ日時 2023-07-25 12:17:55
合計ジャッジ時間 4,249 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,480 KB
testcase_01 AC 80 ms
71,384 KB
testcase_02 AC 79 ms
71,224 KB
testcase_03 WA -
testcase_04 AC 77 ms
71,392 KB
testcase_05 AC 76 ms
71,288 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353
n = int(input())
dp = [[0] * (n + 1) for _ in range(n + 1)]
dp[0][0] = 1
for i in range(n):
    for j in range(n):
        dp[i][j] %= MOD
        dp[i + 1][j] += dp[i][j] * 25
        dp[i + 1][j + 1] += dp[i][j]
ans = 0
for i in range(n + 1):
    ans += dp[n][i] * (i // 3)
print(ans)
0