結果

問題 No.1005 BOT対策
ユーザー kohei2019kohei2019
提出日時 2022-01-03 21:25:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 54 ms / 2,000 ms
コード長 255 bytes
コンパイル時間 676 ms
コンパイル使用メモリ 82,512 KB
実行使用メモリ 60,364 KB
最終ジャッジ日時 2024-04-21 10:40:45
合計ジャッジ時間 3,122 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
53,612 KB
testcase_01 AC 44 ms
51,880 KB
testcase_02 AC 45 ms
52,204 KB
testcase_03 AC 45 ms
53,772 KB
testcase_04 AC 46 ms
52,192 KB
testcase_05 AC 45 ms
52,188 KB
testcase_06 AC 45 ms
53,156 KB
testcase_07 AC 45 ms
52,148 KB
testcase_08 AC 45 ms
52,664 KB
testcase_09 AC 44 ms
52,892 KB
testcase_10 AC 45 ms
53,176 KB
testcase_11 AC 44 ms
52,720 KB
testcase_12 AC 46 ms
53,176 KB
testcase_13 AC 47 ms
53,240 KB
testcase_14 AC 47 ms
54,532 KB
testcase_15 AC 46 ms
52,960 KB
testcase_16 AC 46 ms
54,812 KB
testcase_17 AC 44 ms
53,476 KB
testcase_18 AC 46 ms
53,132 KB
testcase_19 AC 45 ms
51,832 KB
testcase_20 AC 48 ms
52,808 KB
testcase_21 AC 44 ms
53,196 KB
testcase_22 AC 45 ms
52,660 KB
testcase_23 AC 46 ms
52,620 KB
testcase_24 AC 47 ms
53,584 KB
testcase_25 AC 49 ms
58,156 KB
testcase_26 AC 50 ms
58,216 KB
testcase_27 AC 45 ms
51,704 KB
testcase_28 AC 54 ms
60,364 KB
testcase_29 AC 46 ms
53,448 KB
権限があれば一括ダウンロードができます

ソースコード

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