結果

問題 No.1005 BOT対策
ユーザー ttr
提出日時 2020-03-06 21:44:41
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 359 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-10-14 10:30:11
合計ジャッジ時間 2,041 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
T = input()

n = len(T)
ans = 0
if T in S and n > 1:
    i = 0
    while i < len(S)-n+1:
        cnt = 0
        for j in range(n):
            if S[i+j] == T[j]:
                cnt += 1
        if cnt == n:
            ans += 1
            i += n
        else:
            i += 1
elif T in S and n == 1:
    ans = -1
else:
    ans = 0
print(ans)
0