結果

問題 No.1005 BOT対策
ユーザー kohei2019
提出日時 2022-01-03 21:25:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 255 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 82,588 KB
実行使用メモリ 59,920 KB
最終ジャッジ日時 2025-06-20 01:38:43
合計ジャッジ時間 2,426 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

S = list(input())
T = input()
NT = len(T)
if NT == 1 and T in S:
    print(-1)
    exit()
cnt = 0
pont = 0
while pont < len(S)-NT+1:
    s = ''.join(S[pont:pont+NT])
    if s == T:
        S.insert(pont+NT-1,'.')
        cnt += 1
    pont += 1
print(cnt)
0