結果

問題 No.1005 BOT対策
ユーザー mlihua09mlihua09
提出日時 2020-09-01 21:24:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 226 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 82,416 KB
実行使用メモリ 53,980 KB
最終ジャッジ日時 2024-04-30 19:50:52
合計ジャッジ時間 2,753 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,188 KB
testcase_01 AC 41 ms
53,564 KB
testcase_02 AC 39 ms
52,872 KB
testcase_03 AC 39 ms
52,396 KB
testcase_04 AC 40 ms
53,912 KB
testcase_05 AC 39 ms
52,028 KB
testcase_06 AC 41 ms
52,796 KB
testcase_07 AC 41 ms
52,884 KB
testcase_08 AC 41 ms
52,124 KB
testcase_09 AC 42 ms
52,600 KB
testcase_10 AC 40 ms
52,396 KB
testcase_11 AC 39 ms
52,628 KB
testcase_12 AC 41 ms
52,884 KB
testcase_13 AC 40 ms
52,468 KB
testcase_14 AC 39 ms
53,312 KB
testcase_15 AC 40 ms
53,852 KB
testcase_16 AC 40 ms
52,880 KB
testcase_17 AC 40 ms
52,488 KB
testcase_18 AC 39 ms
52,468 KB
testcase_19 AC 40 ms
52,484 KB
testcase_20 AC 40 ms
52,072 KB
testcase_21 AC 40 ms
53,980 KB
testcase_22 AC 40 ms
51,824 KB
testcase_23 AC 40 ms
52,072 KB
testcase_24 AC 40 ms
53,664 KB
testcase_25 AC 39 ms
52,688 KB
testcase_26 AC 41 ms
52,012 KB
testcase_27 AC 39 ms
52,920 KB
testcase_28 AC 41 ms
52,408 KB
testcase_29 AC 39 ms
52,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


S = input()
T = input()
n = len(T)

if n == 1:
    if T in S:
        print(-1)
    else:
        print(0)
    exit()
        

ans = 0

i = S.find(T)

while i != -1:
    ans += 1
    i = S.find(T, i + n - 1)
print(ans)
    
0