結果

問題 No.1702 count good string
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-10-08 22:19:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 465 bytes
コンパイル時間 332 ms
コンパイル使用メモリ 86,628 KB
実行使用メモリ 76,868 KB
最終ジャッジ日時 2023-09-30 10:43:47
合計ジャッジ時間 6,556 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,036 KB
testcase_01 AC 70 ms
70,968 KB
testcase_02 AC 69 ms
70,968 KB
testcase_03 AC 68 ms
70,964 KB
testcase_04 AC 69 ms
70,796 KB
testcase_05 AC 69 ms
70,992 KB
testcase_06 AC 68 ms
71,036 KB
testcase_07 AC 69 ms
70,988 KB
testcase_08 AC 71 ms
71,092 KB
testcase_09 AC 70 ms
70,968 KB
testcase_10 AC 69 ms
70,964 KB
testcase_11 AC 69 ms
70,988 KB
testcase_12 AC 68 ms
71,032 KB
testcase_13 AC 103 ms
76,584 KB
testcase_14 AC 100 ms
76,792 KB
testcase_15 AC 99 ms
76,704 KB
testcase_16 AC 99 ms
76,580 KB
testcase_17 AC 100 ms
76,584 KB
testcase_18 AC 102 ms
76,684 KB
testcase_19 AC 101 ms
76,816 KB
testcase_20 AC 100 ms
76,800 KB
testcase_21 AC 99 ms
76,328 KB
testcase_22 AC 100 ms
76,748 KB
testcase_23 AC 76 ms
75,928 KB
testcase_24 AC 76 ms
76,300 KB
testcase_25 AC 75 ms
75,760 KB
testcase_26 AC 74 ms
75,692 KB
testcase_27 AC 76 ms
76,208 KB
testcase_28 AC 76 ms
75,444 KB
testcase_29 AC 74 ms
75,232 KB
testcase_30 AC 74 ms
75,900 KB
testcase_31 AC 74 ms
75,144 KB
testcase_32 AC 77 ms
75,592 KB
testcase_33 AC 92 ms
76,868 KB
testcase_34 AC 92 ms
76,696 KB
testcase_35 AC 90 ms
76,232 KB
testcase_36 AC 91 ms
75,752 KB
testcase_37 AC 98 ms
76,860 KB
testcase_38 AC 94 ms
76,376 KB
testcase_39 AC 91 ms
76,112 KB
testcase_40 AC 91 ms
76,192 KB
testcase_41 AC 91 ms
76,260 KB
testcase_42 AC 91 ms
76,368 KB
testcase_43 AC 92 ms
75,840 KB
testcase_44 AC 101 ms
76,824 KB
testcase_45 AC 70 ms
70,520 KB
testcase_46 AC 73 ms
70,468 KB
testcase_47 AC 69 ms
70,508 KB
testcase_48 AC 70 ms
70,832 KB
testcase_49 AC 69 ms
70,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
S = input()
dp = [[0]*2 for i in range(10)]
dp[0][0] = 1
mod = 10**9+7
t = list("yukicoder")
for s in S:
    if s not in t and s != "?":
        continue
    
    for j in range(9)[::-1]:
        if s == t[j]:
            dp[j+1][0] += dp[j][0]
            dp[j+1][1] += dp[j][1]
            dp[j+1][0] %= mod
            dp[j+1][1] %= mod
        if s == "?":
            dp[j+1][1] += dp[j][0]
            dp[j+1][1] %= mod
print(sum(dp[-1])%mod)
0