結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,416 KB
testcase_01 AC 74 ms
71,324 KB
testcase_02 AC 72 ms
71,412 KB
testcase_03 AC 76 ms
71,380 KB
testcase_04 AC 75 ms
71,180 KB
testcase_05 AC 73 ms
71,416 KB
testcase_06 AC 74 ms
71,352 KB
testcase_07 AC 72 ms
71,320 KB
testcase_08 AC 74 ms
71,668 KB
testcase_09 AC 74 ms
71,328 KB
testcase_10 AC 73 ms
71,412 KB
testcase_11 AC 74 ms
71,616 KB
testcase_12 AC 73 ms
71,424 KB
testcase_13 AC 92 ms
77,108 KB
testcase_14 AC 95 ms
77,304 KB
testcase_15 AC 92 ms
77,148 KB
testcase_16 AC 99 ms
77,396 KB
testcase_17 AC 92 ms
77,384 KB
testcase_18 AC 98 ms
77,376 KB
testcase_19 AC 95 ms
77,184 KB
testcase_20 AC 91 ms
77,216 KB
testcase_21 AC 90 ms
77,176 KB
testcase_22 AC 94 ms
77,236 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
76,676 KB
testcase_44 AC 97 ms
77,540 KB
testcase_45 AC 73 ms
71,528 KB
testcase_46 AC 74 ms
71,236 KB
testcase_47 AC 73 ms
71,420 KB
testcase_48 AC 73 ms
71,576 KB
testcase_49 AC 72 ms
71,416 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:
        for i in range(9):
            Y[i+1] = (Y[i+1] + X[i]) % P

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