結果
| 問題 | No.1005 BOT対策 |
| コンテスト | |
| ユーザー |
s_shohei
|
| 提出日時 | 2020-04-11 14:37:57 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 56 ms / 2,000 ms |
| + 131µs | |
| コード長 | 396 bytes |
| 記録 | |
| コンパイル時間 | 458 ms |
| コンパイル使用メモリ | 95,460 KB |
| 実行使用メモリ | 79,088 KB |
| 最終ジャッジ日時 | 2026-07-12 08:24:16 |
| 合計ジャッジ時間 | 3,922 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
ソースコード
s=input()
t=input()
if len(t)==1 and s.count(t)>0:
print(-1)
exit()
t_now=0
ans=0
for i in range(len(s)):
if s[i] == t[t_now]:
if t_now+1 == len(t):
ans+=1
if t[-1] == t[0]:
t_now=1
else:
t_now=0
else:
t_now+=1
elif s[i] == t[0]:
t_now=1
else:
t_now=0
print(ans)
s_shohei