結果

問題 No.1702 count good string
ユーザー vwxyzvwxyz
提出日時 2021-10-08 22:52:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 389 ms / 2,000 ms
コード長 448 bytes
コンパイル時間 1,547 ms
コンパイル使用メモリ 87,064 KB
実行使用メモリ 77,716 KB
最終ジャッジ日時 2023-09-30 12:02:04
合計ジャッジ時間 12,059 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,468 KB
testcase_01 AC 69 ms
71,476 KB
testcase_02 AC 75 ms
76,144 KB
testcase_03 AC 80 ms
76,728 KB
testcase_04 AC 83 ms
76,764 KB
testcase_05 AC 77 ms
76,828 KB
testcase_06 AC 76 ms
76,664 KB
testcase_07 AC 79 ms
76,664 KB
testcase_08 AC 78 ms
76,692 KB
testcase_09 AC 81 ms
76,844 KB
testcase_10 AC 79 ms
76,844 KB
testcase_11 AC 82 ms
76,848 KB
testcase_12 AC 78 ms
76,752 KB
testcase_13 AC 289 ms
77,432 KB
testcase_14 AC 296 ms
77,512 KB
testcase_15 AC 295 ms
77,528 KB
testcase_16 AC 290 ms
77,272 KB
testcase_17 AC 289 ms
77,464 KB
testcase_18 AC 290 ms
77,392 KB
testcase_19 AC 389 ms
77,536 KB
testcase_20 AC 289 ms
77,384 KB
testcase_21 AC 387 ms
77,668 KB
testcase_22 AC 295 ms
77,400 KB
testcase_23 AC 88 ms
76,796 KB
testcase_24 AC 88 ms
76,588 KB
testcase_25 AC 86 ms
76,768 KB
testcase_26 AC 85 ms
76,796 KB
testcase_27 AC 86 ms
76,920 KB
testcase_28 AC 91 ms
77,092 KB
testcase_29 AC 87 ms
76,688 KB
testcase_30 AC 85 ms
76,804 KB
testcase_31 AC 85 ms
77,080 KB
testcase_32 AC 86 ms
76,852 KB
testcase_33 AC 280 ms
77,456 KB
testcase_34 AC 280 ms
77,444 KB
testcase_35 AC 279 ms
77,396 KB
testcase_36 AC 276 ms
77,452 KB
testcase_37 AC 282 ms
77,320 KB
testcase_38 AC 282 ms
77,716 KB
testcase_39 AC 280 ms
77,508 KB
testcase_40 AC 278 ms
77,372 KB
testcase_41 AC 283 ms
77,376 KB
testcase_42 AC 281 ms
77,208 KB
testcase_43 AC 286 ms
77,448 KB
testcase_44 AC 280 ms
77,476 KB
testcase_45 AC 69 ms
71,652 KB
testcase_46 AC 70 ms
71,272 KB
testcase_47 AC 71 ms
71,144 KB
testcase_48 AC 70 ms
71,464 KB
testcase_49 AC 71 ms
71,560 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