結果

問題 No.871 かえるのうた
ユーザー Mine
提出日時 2020-09-06 22:29:50
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 391 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 28,428 KB
最終ジャッジ日時 2024-11-29 07:42:38
合計ジャッジ時間 8,175 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23 WA * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
n, k = map(int, input().split())
x = list(map(int, input().split()))
a = list(map(int, input().split()))

now = k-1
l = x[now] - a[now]
r = x[now] + a[now]

for i in range(n):
    bl = bisect.bisect_left(x, l)
    br = bisect.bisect_right(x, r) - 1
    l = min(l, x[bl] - a[bl])
    r = max(r, x[br] + a[br])

ans = 0
print(bisect.bisect_right(x, r) - bisect.bisect_left(x, l))
0