結果

問題 No.1702 count good string
ユーザー 👑 rin204rin204
提出日時 2022-01-23 01:03:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 225 ms / 2,000 ms
コード長 404 bytes
コンパイル時間 555 ms
コンパイル使用メモリ 87,260 KB
実行使用メモリ 77,476 KB
最終ジャッジ日時 2023-08-18 23:20:25
合計ジャッジ時間 9,891 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,408 KB
testcase_01 AC 75 ms
71,212 KB
testcase_02 AC 76 ms
76,276 KB
testcase_03 AC 80 ms
76,488 KB
testcase_04 AC 80 ms
76,736 KB
testcase_05 AC 79 ms
76,572 KB
testcase_06 AC 80 ms
76,580 KB
testcase_07 AC 77 ms
76,440 KB
testcase_08 AC 79 ms
76,684 KB
testcase_09 AC 78 ms
76,628 KB
testcase_10 AC 78 ms
76,732 KB
testcase_11 AC 82 ms
76,740 KB
testcase_12 AC 78 ms
76,684 KB
testcase_13 AC 179 ms
77,300 KB
testcase_14 AC 176 ms
77,216 KB
testcase_15 AC 177 ms
77,368 KB
testcase_16 AC 178 ms
77,288 KB
testcase_17 AC 178 ms
77,300 KB
testcase_18 AC 178 ms
77,456 KB
testcase_19 AC 179 ms
77,196 KB
testcase_20 AC 173 ms
77,476 KB
testcase_21 AC 174 ms
77,352 KB
testcase_22 AC 177 ms
77,300 KB
testcase_23 AC 84 ms
76,636 KB
testcase_24 AC 83 ms
76,380 KB
testcase_25 AC 87 ms
76,668 KB
testcase_26 AC 82 ms
76,748 KB
testcase_27 AC 83 ms
76,540 KB
testcase_28 AC 81 ms
76,400 KB
testcase_29 AC 82 ms
76,820 KB
testcase_30 AC 83 ms
76,344 KB
testcase_31 AC 85 ms
76,816 KB
testcase_32 AC 83 ms
76,704 KB
testcase_33 AC 219 ms
77,220 KB
testcase_34 AC 156 ms
77,172 KB
testcase_35 AC 159 ms
77,180 KB
testcase_36 AC 166 ms
77,344 KB
testcase_37 AC 163 ms
77,056 KB
testcase_38 AC 163 ms
77,448 KB
testcase_39 AC 165 ms
77,024 KB
testcase_40 AC 163 ms
77,268 KB
testcase_41 AC 159 ms
77,344 KB
testcase_42 AC 225 ms
77,432 KB
testcase_43 AC 165 ms
77,452 KB
testcase_44 AC 174 ms
77,332 KB
testcase_45 AC 73 ms
71,436 KB
testcase_46 AC 71 ms
71,544 KB
testcase_47 AC 71 ms
71,256 KB
testcase_48 AC 73 ms
71,416 KB
testcase_49 AC 72 ms
71,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7

n = int(input())
S = input()
lst = ["yukicoder"]
yu = "yukicoder"
for i in range(9):
    t = yu[:i] + "?" + yu[i + 1:]
    lst.append(t)
    
ans = 0
for t in lst:
    dp = [0] * 10
    dp[0] = 1
    for s in S:
        for i in range(8, -1, -1):
            if t[i] == s:
                dp[i + 1] += dp[i]
                dp[i + 1] %= MOD
    ans += dp[-1]
    ans %= MOD

print(ans)
0