結果

問題 No.2131 Concon Substrings (COuNt Version)
ユーザー SidewaysOwlSidewaysOwl
提出日時 2022-11-25 23:17:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 82,788 KB
実行使用メモリ 76,476 KB
最終ジャッジ日時 2024-04-10 04:21:02
合計ジャッジ時間 2,373 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,000 KB
testcase_01 AC 37 ms
52,416 KB
testcase_02 AC 36 ms
54,272 KB
testcase_03 AC 82 ms
75,936 KB
testcase_04 AC 36 ms
52,068 KB
testcase_05 AC 37 ms
52,544 KB
testcase_06 AC 36 ms
53,084 KB
testcase_07 AC 125 ms
75,784 KB
testcase_08 AC 69 ms
76,112 KB
testcase_09 AC 118 ms
75,788 KB
testcase_10 AC 121 ms
76,028 KB
testcase_11 AC 98 ms
75,852 KB
testcase_12 AC 97 ms
76,168 KB
testcase_13 AC 40 ms
58,444 KB
testcase_14 AC 68 ms
76,248 KB
testcase_15 AC 68 ms
76,476 KB
testcase_16 AC 41 ms
58,560 KB
testcase_17 AC 65 ms
75,816 KB
testcase_18 AC 66 ms
75,720 KB
testcase_19 AC 49 ms
68,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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