結果

問題 No.430 文字列検索
ユーザー 💕💖💞💕💖💞
提出日時 2017-01-28 17:41:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,968 ms / 2,000 ms
コード長 300 bytes
コンパイル時間 131 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,392 KB
最終ジャッジ日時 2024-06-06 07:52:55
合計ジャッジ時間 11,851 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,496 KB
testcase_01 AC 416 ms
11,136 KB
testcase_02 AC 527 ms
11,136 KB
testcase_03 AC 392 ms
11,136 KB
testcase_04 AC 27 ms
10,624 KB
testcase_05 AC 28 ms
10,496 KB
testcase_06 AC 27 ms
10,752 KB
testcase_07 AC 27 ms
10,496 KB
testcase_08 AC 28 ms
10,752 KB
testcase_09 AC 28 ms
10,624 KB
testcase_10 AC 32 ms
10,624 KB
testcase_11 AC 1,968 ms
11,392 KB
testcase_12 AC 1,621 ms
11,264 KB
testcase_13 AC 1,623 ms
11,264 KB
testcase_14 AC 1,446 ms
11,264 KB
testcase_15 AC 1,375 ms
11,136 KB
testcase_16 AC 736 ms
11,136 KB
testcase_17 AC 716 ms
11,008 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