結果

問題 No.430 文字列検索
ユーザー 💕💖💞💕💖💞
提出日時 2017-01-28 17:41:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 300 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 10,652 KB
実行使用メモリ 8,748 KB
最終ジャッジ日時 2023-08-25 13:19:36
合計ジャッジ時間 12,581 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,776 KB
testcase_01 AC 464 ms
8,644 KB
testcase_02 AC 523 ms
8,628 KB
testcase_03 AC 389 ms
8,732 KB
testcase_04 AC 15 ms
7,856 KB
testcase_05 AC 16 ms
7,804 KB
testcase_06 AC 15 ms
7,744 KB
testcase_07 AC 16 ms
7,824 KB
testcase_08 AC 17 ms
8,276 KB
testcase_09 AC 16 ms
7,856 KB
testcase_10 AC 20 ms
7,860 KB
testcase_11 TLE -
testcase_12 AC 1,661 ms
8,684 KB
testcase_13 AC 1,655 ms
8,748 KB
testcase_14 AC 1,490 ms
8,700 KB
testcase_15 AC 1,447 ms
8,596 KB
testcase_16 AC 756 ms
8,708 KB
testcase_17 AC 723 ms
8,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def counter(s: str, t: str) -> int:
    m = 0
    while True:
        if len(s) < len(t) or t not in s:  break
        if t in s:
            m += 1
            s = s[s.index(t)+1:]
    return m
s = input()
print(sum( counter(s, t) if t in s else 0 for t in [input() for _ in range(int(input()))] ) )
0