結果

問題 No.1005 BOT対策
ユーザー miya145592miya145592
提出日時 2023-05-19 01:26:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 362 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 86,900 KB
実行使用メモリ 75,684 KB
最終ジャッジ日時 2023-08-22 14:36:44
合計ジャッジ時間 3,609 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,280 KB
testcase_01 AC 69 ms
71,440 KB
testcase_02 AC 69 ms
71,324 KB
testcase_03 AC 67 ms
70,892 KB
testcase_04 AC 68 ms
71,048 KB
testcase_05 AC 68 ms
71,396 KB
testcase_06 AC 67 ms
71,244 KB
testcase_07 AC 68 ms
71,408 KB
testcase_08 AC 67 ms
71,056 KB
testcase_09 AC 66 ms
71,292 KB
testcase_10 AC 67 ms
71,236 KB
testcase_11 AC 68 ms
71,064 KB
testcase_12 AC 68 ms
70,896 KB
testcase_13 AC 69 ms
71,276 KB
testcase_14 AC 71 ms
75,436 KB
testcase_15 AC 69 ms
71,308 KB
testcase_16 AC 69 ms
71,344 KB
testcase_17 AC 70 ms
71,244 KB
testcase_18 AC 70 ms
71,268 KB
testcase_19 AC 68 ms
71,192 KB
testcase_20 AC 69 ms
71,312 KB
testcase_21 AC 70 ms
71,324 KB
testcase_22 AC 69 ms
71,200 KB
testcase_23 AC 69 ms
71,336 KB
testcase_24 AC 70 ms
75,572 KB
testcase_25 AC 73 ms
75,628 KB
testcase_26 AC 73 ms
75,684 KB
testcase_27 AC 66 ms
71,084 KB
testcase_28 AC 72 ms
75,664 KB
testcase_29 AC 67 ms
71,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
T = input()
if len(T)==1:
    if S.count(T)==0:
        print(0)
    else:
        print(-1)
    exit()
i = 0
j = 0
cnt = 0
while i<len(S):
    if S[i]!=T[j]:
        if j==0:
            i+=1
        else:
            j=0
    else:
        if j==len(T)-1:
            cnt+=1
            j=0
        else:
            i+=1
            j+=1
print(cnt)
0