結果

問題 No.1702 count good string
ユーザー kohei2019kohei2019
提出日時 2023-06-04 18:01:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 600 bytes
コンパイル時間 347 ms
コンパイル使用メモリ 86,968 KB
実行使用メモリ 77,748 KB
最終ジャッジ日時 2023-08-28 08:18:02
合計ジャッジ時間 7,097 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,288 KB
testcase_01 AC 71 ms
71,224 KB
testcase_02 AC 70 ms
71,404 KB
testcase_03 AC 71 ms
71,288 KB
testcase_04 AC 70 ms
71,084 KB
testcase_05 AC 70 ms
71,084 KB
testcase_06 AC 71 ms
71,496 KB
testcase_07 AC 73 ms
71,172 KB
testcase_08 AC 74 ms
71,228 KB
testcase_09 AC 70 ms
71,080 KB
testcase_10 AC 69 ms
71,232 KB
testcase_11 AC 69 ms
71,484 KB
testcase_12 AC 70 ms
71,288 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 78 ms
76,516 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 76 ms
76,768 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 88 ms
77,064 KB
testcase_44 WA -
testcase_45 AC 74 ms
71,520 KB
testcase_46 AC 71 ms
71,356 KB
testcase_47 AC 71 ms
71,396 KB
testcase_48 AC 71 ms
71,076 KB
testcase_49 AC 69 ms
71,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()
mod = 10**9+7
# i文字目まで見てyukicoderのj文字目まできて?をk個
yuki = 'yukicoder'
dp = [[0]*(len(yuki)+1) for i in range(2)]
dp[0][0] = 1
for i in range(N):
    if S[i] != "?":
        for j in range(1,len(yuki)+1):
            if S[i] == yuki[j-1]:
                dp[0][j] += dp[0][j-1]
                dp[0][j] %= mod
                dp[1][j] += dp[1][j-1]
                dp[0][j] %= mod
            
    if S[i] == "?":
        for j in range(1,len(yuki)+1):
            dp[1][j] += dp[0][j-1]
            dp[0][j] %= mod
print(dp[0][-1]+dp[1][-1])
0