結果

問題 No.1702 count good string
ユーザー mink1618033mink1618033
提出日時 2021-10-08 23:53:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 855 bytes
コンパイル時間 830 ms
コンパイル使用メモリ 87,276 KB
実行使用メモリ 133,860 KB
最終ジャッジ日時 2023-09-30 14:21:14
合計ジャッジ時間 11,211 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,604 KB
testcase_01 AC 71 ms
71,344 KB
testcase_02 AC 75 ms
75,880 KB
testcase_03 AC 79 ms
76,680 KB
testcase_04 AC 80 ms
76,712 KB
testcase_05 AC 79 ms
76,616 KB
testcase_06 AC 81 ms
76,656 KB
testcase_07 AC 79 ms
76,616 KB
testcase_08 AC 78 ms
76,736 KB
testcase_09 AC 79 ms
76,800 KB
testcase_10 AC 80 ms
76,832 KB
testcase_11 AC 82 ms
76,780 KB
testcase_12 AC 80 ms
76,688 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 88 ms
76,860 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 86 ms
76,784 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 285 ms
133,808 KB
testcase_44 AC 289 ms
133,648 KB
testcase_45 AC 71 ms
71,276 KB
testcase_46 AC 71 ms
71,368 KB
testcase_47 AC 70 ms
71,620 KB
testcase_48 AC 70 ms
71,492 KB
testcase_49 AC 72 ms
71,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
n = int(input())
if n<9:
    print(0)
    sys.exit()
s = input()
p = 10**9+7
ans = 0
keys = []
key = list("yukicoder")
keys.append({'y': 0, 'u': 1, 'k': 2, 'i': 3, 'c': 4, 'o': 5, 'd': 6, 'e': 7, 'r': 8})
for k in range(9):
    di = {}
    for kk in range(9):
        if k==kk:
            di["?"]=kk
        else:
            di[key[kk]]=kk
    keys.append(di)
    #print(di)

for di in keys:
    dp = [[0]*(n+1) for _ in range(9)]
    for i in range(n):
        if s[i] in di:
            ind = di[s[i]]
        else:
            ind = 9
        for j in range(9):
            if j==ind:
                if j==0:
                    dp[j][i+1]=(dp[j][i]+1)%p
                else:
                    dp[j][i+1]=(dp[j][i]+dp[j-1][i])%p
            else:
                dp[j][i+1]=(dp[j][i])%p
    ans+=dp[8][n]%p
    #print(ans)
print(ans)
0