結果

問題 No.1702 count good string
ユーザー Kiri8128Kiri8128
提出日時 2021-10-08 22:25:54
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 438 bytes
コンパイル時間 593 ms
コンパイル使用メモリ 86,648 KB
実行使用メモリ 78,920 KB
最終ジャッジ日時 2023-09-30 10:54:35
合計ジャッジ時間 7,884 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
70,992 KB
testcase_01 RE -
testcase_02 AC 71 ms
71,012 KB
testcase_03 AC 74 ms
71,168 KB
testcase_04 AC 73 ms
71,028 KB
testcase_05 AC 71 ms
70,972 KB
testcase_06 AC 73 ms
70,972 KB
testcase_07 AC 72 ms
71,208 KB
testcase_08 AC 74 ms
70,864 KB
testcase_09 AC 74 ms
70,868 KB
testcase_10 AC 75 ms
70,804 KB
testcase_11 AC 72 ms
71,044 KB
testcase_12 AC 73 ms
70,968 KB
testcase_13 AC 91 ms
76,808 KB
testcase_14 AC 93 ms
76,708 KB
testcase_15 AC 93 ms
76,860 KB
testcase_16 AC 96 ms
76,676 KB
testcase_17 AC 94 ms
76,692 KB
testcase_18 AC 99 ms
76,744 KB
testcase_19 AC 100 ms
76,704 KB
testcase_20 AC 95 ms
76,864 KB
testcase_21 AC 96 ms
76,852 KB
testcase_22 AC 97 ms
76,624 KB
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 RE -
testcase_43 AC 87 ms
76,092 KB
testcase_44 AC 97 ms
76,700 KB
testcase_45 AC 74 ms
71,104 KB
testcase_46 AC 72 ms
70,664 KB
testcase_47 AC 72 ms
71,148 KB
testcase_48 AC 73 ms
71,016 KB
testcase_49 AC 75 ms
71,036 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:
        assert s == "?"
        for j in range(9):
            Y[j+1] = (Y[j+1] + X[j]) % P

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