結果
問題 |
No.1005 BOT対策
|
ユーザー |
![]() |
提出日時 | 2020-03-06 21:26:36 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 485 bytes |
コンパイル時間 | 150 ms |
コンパイル使用メモリ | 82,024 KB |
実行使用メモリ | 54,420 KB |
最終ジャッジ日時 | 2024-10-14 10:21:31 |
合計ジャッジ時間 | 2,119 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 14 WA * 13 |
ソースコード
def main(): import sys input = sys.stdin.readline S = input().rstrip('\n') T = input().rstrip('\n') nt = len(T) N = len(S) if len(T) == 1: if S.count(T) > 0: print(-1) else: print(0) i = 0 ans = 0 while True: if S[i:i+nt] == T: ans += 1 i = i+1 else: i += 1 if i >= N: break print(ans) if __name__ == '__main__': main()