結果
問題 | No.1702 count good string |
ユーザー | NatsubiSogan |
提出日時 | 2021-10-08 22:26:44 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 598 bytes |
コンパイル時間 | 510 ms |
コンパイル使用メモリ | 87,116 KB |
実行使用メモリ | 228,536 KB |
最終ジャッジ日時 | 2023-09-30 10:57:37 |
合計ジャッジ時間 | 19,194 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 75 ms
71,512 KB |
testcase_01 | AC | 75 ms
70,948 KB |
testcase_02 | AC | 82 ms
76,004 KB |
testcase_03 | AC | 86 ms
76,072 KB |
testcase_04 | AC | 91 ms
76,504 KB |
testcase_05 | AC | 85 ms
76,528 KB |
testcase_06 | AC | 82 ms
76,464 KB |
testcase_07 | AC | 85 ms
76,532 KB |
testcase_08 | AC | 84 ms
76,204 KB |
testcase_09 | AC | 87 ms
76,748 KB |
testcase_10 | AC | 86 ms
76,564 KB |
testcase_11 | AC | 90 ms
76,500 KB |
testcase_12 | AC | 84 ms
76,468 KB |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | AC | 99 ms
76,772 KB |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | AC | 98 ms
76,808 KB |
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 | 624 ms
228,104 KB |
testcase_44 | AC | 616 ms
227,876 KB |
testcase_45 | AC | 74 ms
71,144 KB |
testcase_46 | AC | 72 ms
71,336 KB |
testcase_47 | AC | 73 ms
71,336 KB |
testcase_48 | AC | 73 ms
71,408 KB |
testcase_49 | AC | 73 ms
71,156 KB |
ソースコード
ans = 0 n = int(input()) s = input() ans = 0 def main(s, t): global ans n = len(s) t = list(t) dp = [[0] * (len(t) + 1) for i in range(n + 1)] dp[0][0] = 1 mod = 10 ** 9 + 7 for i in range(n): try: ind = t.index(s[i]) except: ind = len(t) + 1 for j in range(len(t) + 1): dp[i + 1][j] += dp[i][j] if j == ind: dp[i + 1][j + 1] += dp[i][j]; dp[i + 1][j + 1] %= mod dp[i + 1][j] %= mod ans += dp[-1][-1] ts = ["yukicoder", "?ukicoder", "y?kicoder", "yu?icoder", "yuk?coder", "yuki?oder", "yukic?der", "yukico?er", "yukicod?r", "yukicode?"] for t in ts: main(s, t) print(ans)