結果

問題 No.1702 count good string
ユーザー Kiri8128Kiri8128
提出日時 2021-10-08 22:26:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 87,268 KB
実行使用メモリ 77,112 KB
最終ジャッジ日時 2023-09-30 10:56:39
合計ジャッジ時間 6,415 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,092 KB
testcase_01 AC 74 ms
71,296 KB
testcase_02 AC 73 ms
71,200 KB
testcase_03 AC 73 ms
71,328 KB
testcase_04 AC 73 ms
71,292 KB
testcase_05 AC 74 ms
71,268 KB
testcase_06 AC 74 ms
70,932 KB
testcase_07 AC 71 ms
71,368 KB
testcase_08 AC 72 ms
71,132 KB
testcase_09 AC 71 ms
71,224 KB
testcase_10 AC 73 ms
71,272 KB
testcase_11 AC 72 ms
71,256 KB
testcase_12 AC 72 ms
71,300 KB
testcase_13 AC 91 ms
77,008 KB
testcase_14 AC 93 ms
77,056 KB
testcase_15 AC 90 ms
76,924 KB
testcase_16 AC 94 ms
76,936 KB
testcase_17 AC 90 ms
76,900 KB
testcase_18 AC 97 ms
76,916 KB
testcase_19 AC 95 ms
77,060 KB
testcase_20 AC 91 ms
76,916 KB
testcase_21 AC 90 ms
76,884 KB
testcase_22 AC 96 ms
76,940 KB
testcase_23 AC 77 ms
76,348 KB
testcase_24 AC 77 ms
76,400 KB
testcase_25 AC 78 ms
76,684 KB
testcase_26 AC 80 ms
76,676 KB
testcase_27 AC 81 ms
76,404 KB
testcase_28 AC 80 ms
76,492 KB
testcase_29 AC 80 ms
76,356 KB
testcase_30 AC 79 ms
76,388 KB
testcase_31 AC 78 ms
76,384 KB
testcase_32 AC 79 ms
76,432 KB
testcase_33 AC 92 ms
77,112 KB
testcase_34 AC 94 ms
77,012 KB
testcase_35 AC 91 ms
77,040 KB
testcase_36 AC 91 ms
76,932 KB
testcase_37 AC 98 ms
76,956 KB
testcase_38 AC 92 ms
77,036 KB
testcase_39 AC 97 ms
76,944 KB
testcase_40 AC 93 ms
77,020 KB
testcase_41 AC 92 ms
76,912 KB
testcase_42 AC 92 ms
77,044 KB
testcase_43 AC 84 ms
76,108 KB
testcase_44 AC 94 ms
77,100 KB
testcase_45 AC 70 ms
71,428 KB
testcase_46 AC 73 ms
71,164 KB
testcase_47 AC 73 ms
71,376 KB
testcase_48 AC 70 ms
70,940 KB
testcase_49 AC 70 ms
71,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

yukicoder = "yukicoder"
P = 10 ** 9 + 7
N = int(input())
S = input()
# assert len(S) == N
X = [0] * 10 # without ?
Y = [0] * 10 # with ?
X[0] = 1
for s in S:
    for i in range(9):
        if s == yukicoder[i]:
            X[i+1] = (X[i+1] + X[i]) % P
            Y[i+1] = (Y[i+1] + Y[i]) % P
            break
    else:
        if s == "?":
            for j in range(9):
                Y[j+1] = (Y[j+1] + X[j]) % P

print((X[9] + Y[9]) % P)
0