結果

問題 No.430 文字列検索
ユーザー 💕💖💞💕💖💞
提出日時 2017-01-28 17:29:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,431 ms / 2,000 ms
コード長 283 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 10,636 KB
実行使用メモリ 8,688 KB
最終ジャッジ日時 2023-08-25 13:18:05
合計ジャッジ時間 9,613 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
7,808 KB
testcase_01 AC 408 ms
8,672 KB
testcase_02 AC 453 ms
8,624 KB
testcase_03 AC 351 ms
8,668 KB
testcase_04 AC 14 ms
7,728 KB
testcase_05 AC 13 ms
7,872 KB
testcase_06 AC 13 ms
7,864 KB
testcase_07 AC 13 ms
7,864 KB
testcase_08 AC 14 ms
8,188 KB
testcase_09 AC 13 ms
7,872 KB
testcase_10 AC 16 ms
7,884 KB
testcase_11 AC 1,431 ms
8,684 KB
testcase_12 AC 1,238 ms
8,688 KB
testcase_13 AC 1,243 ms
8,612 KB
testcase_14 AC 1,083 ms
8,556 KB
testcase_15 AC 1,042 ms
8,536 KB
testcase_16 AC 643 ms
8,588 KB
testcase_17 AC 627 ms
8,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def counter(s: str, t: str) -> int:
    m = 0
    while True:
        if t not in s:  break
        i = s.index(t)
        if t in s[i:]: m += 1
        s = s[i+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