結果

問題 No.1005 BOT対策
ユーザー liny_tailliny_tail
提出日時 2023-02-11 09:53:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 338 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 10,780 KB
実行使用メモリ 8,120 KB
最終ジャッジ日時 2023-09-22 08:42:00
合計ジャッジ時間 1,908 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 14 ms
7,924 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 AC 15 ms
8,044 KB
testcase_05 RE -
testcase_06 AC 14 ms
7,928 KB
testcase_07 AC 14 ms
8,044 KB
testcase_08 AC 14 ms
8,100 KB
testcase_09 AC 14 ms
7,876 KB
testcase_10 AC 15 ms
7,984 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 15 ms
8,120 KB
testcase_19 AC 16 ms
8,064 KB
testcase_20 AC 14 ms
7,948 KB
testcase_21 AC 14 ms
7,876 KB
testcase_22 AC 14 ms
7,928 KB
testcase_23 AC 14 ms
8,032 KB
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 AC 14 ms
8,004 KB
testcase_28 RE -
testcase_29 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input().strip()
T = input().strip()

if S.find(T) < 0:
  print(0)
  exit(0)

if len(T) == 1:
  print(-1)
  exit(0)

cnt = 0
pos = 0

while True:
  tmp = S.find(T, pos)
  if tmp >= 0:
    cnt += 1
    S = S[:tmp + len(T) - 1] + '.' + S[tmp  + len(T)- 1:]
    pos = tmp + len(T)
    print(S)
    input('')
  else:
    break

print(cnt)
0