結果

問題 No.1702 count good string
ユーザー Kiri8128Kiri8128
提出日時 2021-10-08 22:10:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 393 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 87,260 KB
実行使用メモリ 77,364 KB
最終ジャッジ日時 2023-09-30 10:27:50
合計ジャッジ時間 6,494 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
70,792 KB
testcase_01 AC 76 ms
70,772 KB
testcase_02 AC 75 ms
70,668 KB
testcase_03 AC 78 ms
70,724 KB
testcase_04 AC 74 ms
70,296 KB
testcase_05 AC 76 ms
70,656 KB
testcase_06 AC 74 ms
70,816 KB
testcase_07 AC 75 ms
70,716 KB
testcase_08 AC 75 ms
70,704 KB
testcase_09 AC 73 ms
70,820 KB
testcase_10 AC 75 ms
70,788 KB
testcase_11 AC 73 ms
70,636 KB
testcase_12 AC 75 ms
70,792 KB
testcase_13 AC 93 ms
76,208 KB
testcase_14 AC 98 ms
76,476 KB
testcase_15 AC 93 ms
76,500 KB
testcase_16 AC 97 ms
76,724 KB
testcase_17 AC 94 ms
76,520 KB
testcase_18 AC 103 ms
76,568 KB
testcase_19 AC 100 ms
76,408 KB
testcase_20 AC 95 ms
76,684 KB
testcase_21 AC 97 ms
76,612 KB
testcase_22 AC 101 ms
76,648 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
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 85 ms
75,912 KB
testcase_44 AC 99 ms
76,808 KB
testcase_45 AC 75 ms
70,428 KB
testcase_46 AC 73 ms
70,564 KB
testcase_47 AC 77 ms
70,664 KB
testcase_48 AC 74 ms
70,756 KB
testcase_49 AC 73 ms
70,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

yukicoder = "yukicoder"
P = 10 ** 9 + 7
N = int(input())
S = input()
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:
        for i in range(9):
            Y[i+1] = (Y[i+1] + X[i]) % P

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