結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,488 KB
testcase_01 AC 75 ms
71,296 KB
testcase_02 AC 69 ms
71,160 KB
testcase_03 AC 71 ms
71,296 KB
testcase_04 AC 69 ms
71,220 KB
testcase_05 AC 70 ms
71,240 KB
testcase_06 AC 68 ms
71,228 KB
testcase_07 AC 72 ms
71,244 KB
testcase_08 AC 71 ms
71,404 KB
testcase_09 AC 70 ms
71,028 KB
testcase_10 AC 70 ms
71,300 KB
testcase_11 AC 70 ms
71,304 KB
testcase_12 AC 70 ms
71,348 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 98 ms
77,076 KB
testcase_17 AC 97 ms
77,000 KB
testcase_18 AC 97 ms
77,004 KB
testcase_19 WA -
testcase_20 AC 96 ms
76,996 KB
testcase_21 AC 96 ms
77,140 KB
testcase_22 AC 96 ms
77,296 KB
testcase_23 WA -
testcase_24 AC 76 ms
76,576 KB
testcase_25 AC 78 ms
76,316 KB
testcase_26 AC 79 ms
76,752 KB
testcase_27 AC 80 ms
76,472 KB
testcase_28 AC 77 ms
76,312 KB
testcase_29 AC 76 ms
76,472 KB
testcase_30 AC 76 ms
76,608 KB
testcase_31 AC 77 ms
76,656 KB
testcase_32 AC 77 ms
76,544 KB
testcase_33 WA -
testcase_34 AC 95 ms
77,008 KB
testcase_35 AC 94 ms
77,188 KB
testcase_36 WA -
testcase_37 AC 92 ms
77,152 KB
testcase_38 AC 96 ms
77,052 KB
testcase_39 AC 95 ms
77,296 KB
testcase_40 WA -
testcase_41 AC 95 ms
77,044 KB
testcase_42 WA -
testcase_43 AC 90 ms
77,160 KB
testcase_44 AC 90 ms
77,080 KB
testcase_45 AC 70 ms
71,404 KB
testcase_46 AC 70 ms
71,224 KB
testcase_47 AC 71 ms
71,156 KB
testcase_48 AC 70 ms
71,172 KB
testcase_49 AC 69 ms
71,216 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[1][j] %= mod
            
    if S[i] == "?":
        for j in range(1,len(yuki)+1):
            dp[1][j] += dp[0][j-1]
            dp[1][j] %= mod
print(dp[0][-1]+dp[1][-1])
0