結果

問題 No.1702 count good string
ユーザー mink1618033mink1618033
提出日時 2021-10-08 23:50:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 807 bytes
コンパイル時間 366 ms
コンパイル使用メモリ 86,892 KB
実行使用メモリ 133,744 KB
最終ジャッジ日時 2023-09-30 14:17:38
合計ジャッジ時間 10,957 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,120 KB
testcase_01 AC 72 ms
71,216 KB
testcase_02 AC 77 ms
75,828 KB
testcase_03 AC 83 ms
76,592 KB
testcase_04 AC 85 ms
76,552 KB
testcase_05 AC 81 ms
76,544 KB
testcase_06 AC 81 ms
76,688 KB
testcase_07 AC 80 ms
76,544 KB
testcase_08 AC 78 ms
76,432 KB
testcase_09 AC 83 ms
76,536 KB
testcase_10 AC 83 ms
76,524 KB
testcase_11 AC 86 ms
76,692 KB
testcase_12 AC 81 ms
76,456 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 95 ms
76,408 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 90 ms
76,488 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,364 KB
testcase_44 AC 297 ms
133,588 KB
testcase_45 AC 76 ms
71,156 KB
testcase_46 AC 74 ms
71,408 KB
testcase_47 AC 74 ms
71,332 KB
testcase_48 AC 74 ms
71,372 KB
testcase_49 AC 77 ms
71,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
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