結果
問題 |
No.1005 BOT対策
|
ユーザー |
![]() |
提出日時 | 2020-03-06 21:27:42 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 488 bytes |
コンパイル時間 | 184 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 62,464 KB |
最終ジャッジ日時 | 2024-10-14 10:21:26 |
合計ジャッジ時間 | 3,824 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 1 TLE * 1 -- * 25 |
ソースコード
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+nt-1 else: i += 1 if i >= N: break print(ans) if __name__ == '__main__': main()