結果

問題 No.1702 count good string
ユーザー SidewaysOwlSidewaysOwl
提出日時 2021-10-08 22:39:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 313 ms / 2,000 ms
コード長 547 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 156,456 KB
最終ジャッジ日時 2023-09-30 11:39:32
合計ジャッジ時間 11,516 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,568 KB
testcase_01 AC 71 ms
71,196 KB
testcase_02 AC 74 ms
76,212 KB
testcase_03 AC 76 ms
76,120 KB
testcase_04 AC 78 ms
76,256 KB
testcase_05 AC 76 ms
76,144 KB
testcase_06 AC 77 ms
76,172 KB
testcase_07 AC 76 ms
76,316 KB
testcase_08 AC 78 ms
76,224 KB
testcase_09 AC 80 ms
76,244 KB
testcase_10 AC 82 ms
76,024 KB
testcase_11 AC 80 ms
76,252 KB
testcase_12 AC 78 ms
76,148 KB
testcase_13 AC 309 ms
156,080 KB
testcase_14 AC 308 ms
156,292 KB
testcase_15 AC 309 ms
156,188 KB
testcase_16 AC 313 ms
156,092 KB
testcase_17 AC 309 ms
156,032 KB
testcase_18 AC 308 ms
156,116 KB
testcase_19 AC 310 ms
156,320 KB
testcase_20 AC 310 ms
156,272 KB
testcase_21 AC 312 ms
156,376 KB
testcase_22 AC 308 ms
156,264 KB
testcase_23 AC 82 ms
76,212 KB
testcase_24 AC 82 ms
76,308 KB
testcase_25 AC 82 ms
76,152 KB
testcase_26 AC 83 ms
76,156 KB
testcase_27 AC 84 ms
76,260 KB
testcase_28 AC 82 ms
76,260 KB
testcase_29 AC 82 ms
76,244 KB
testcase_30 AC 81 ms
76,360 KB
testcase_31 AC 82 ms
76,308 KB
testcase_32 AC 82 ms
76,160 KB
testcase_33 AC 292 ms
156,280 KB
testcase_34 AC 298 ms
156,272 KB
testcase_35 AC 291 ms
156,080 KB
testcase_36 AC 294 ms
156,312 KB
testcase_37 AC 293 ms
156,208 KB
testcase_38 AC 296 ms
156,112 KB
testcase_39 AC 294 ms
156,220 KB
testcase_40 AC 296 ms
156,296 KB
testcase_41 AC 294 ms
156,232 KB
testcase_42 AC 297 ms
156,208 KB
testcase_43 AC 292 ms
156,080 KB
testcase_44 AC 296 ms
156,456 KB
testcase_45 AC 72 ms
71,152 KB
testcase_46 AC 71 ms
71,408 KB
testcase_47 AC 71 ms
71,408 KB
testcase_48 AC 71 ms
71,416 KB
testcase_49 AC 72 ms
71,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a = list(" yukicoder")
aa = list(" yukicoder")
n = int(input())
s = list(input())
ans = 0
mod = 10 ** 9 + 7
for i in range(10):
    dp = [[0] * (n+1)] +  [[0] * (n+1) for _ in range(9)]
    dp[0][0] = 1
    for j in range(10):
        for k in range(1,n+ 1):
            dp[j][k] += dp[j][k-1]
            dp[j][k] %= mod
            if s[k-1] == a[j]:
                dp[j][k] += dp[j-1][k-1]
                dp[j][k] %= mod
    ans += dp[-1][-1]
    ans %= mod
    if i == 9:break
    a[i+1] = "?"
    a[i] = aa[i]
#     print(dp[-1])
print(ans)
0