結果

問題 No.1702 count good string
ユーザー vwxyzvwxyz
提出日時 2021-10-08 22:51:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 448 bytes
コンパイル時間 217 ms
コンパイル使用メモリ 10,900 KB
実行使用メモリ 8,528 KB
最終ジャッジ日時 2023-09-30 12:03:22
合計ジャッジ時間 50,758 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,848 KB
testcase_01 AC 16 ms
7,808 KB
testcase_02 AC 16 ms
7,912 KB
testcase_03 AC 19 ms
7,820 KB
testcase_04 AC 18 ms
7,816 KB
testcase_05 AC 18 ms
7,980 KB
testcase_06 AC 18 ms
7,816 KB
testcase_07 AC 18 ms
7,784 KB
testcase_08 AC 18 ms
7,816 KB
testcase_09 AC 18 ms
7,852 KB
testcase_10 AC 18 ms
7,912 KB
testcase_11 AC 18 ms
7,920 KB
testcase_12 AC 18 ms
7,784 KB
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 TLE -
testcase_22 TLE -
testcase_23 AC 37 ms
7,868 KB
testcase_24 AC 36 ms
7,780 KB
testcase_25 AC 36 ms
7,820 KB
testcase_26 AC 36 ms
7,824 KB
testcase_27 AC 37 ms
7,908 KB
testcase_28 AC 36 ms
7,848 KB
testcase_29 AC 37 ms
7,992 KB
testcase_30 AC 37 ms
7,992 KB
testcase_31 AC 36 ms
7,920 KB
testcase_32 AC 36 ms
7,860 KB
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
testcase_36 TLE -
testcase_37 TLE -
testcase_38 TLE -
testcase_39 TLE -
testcase_40 TLE -
testcase_41 TLE -
testcase_42 TLE -
testcase_43 TLE -
testcase_44 TLE -
testcase_45 AC 16 ms
7,780 KB
testcase_46 AC 16 ms
7,856 KB
testcase_47 AC 16 ms
7,784 KB
testcase_48 AC 16 ms
7,780 KB
testcase_49 AC 16 ms
7,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline

N=int(readline())
S=readline().rstrip()
lst=["yukicoder"]
for i in range(9):
    s="yukicoder"
    s=s[:i]+"?"+s[i+1:]
    lst.append(s)
mod=10**9+7
ans=0
for ss in lst:
    dp=[0]*10
    dp[0]=1
    for s in S:
        prev=dp
        dp=[x for x in dp]
        for i in range(9):
            if ss[i]==s:
                dp[i+1]+=prev[i]
                dp[i+1]%=mod
    ans+=dp[9]
    ans%=mod
print(ans)
0