結果

問題 No.871 かえるのうた
ユーザー anagohirame
提出日時 2019-08-30 21:40:46
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 336 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 28,208 KB
最終ジャッジ日時 2024-11-21 22:20:25
合計ジャッジ時間 4,279 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
x = list(map(int, input().split()))
a = list(map(int, input().split()))
cur_back, cur_front = k-1, k-1
while cur_back > 0 and x[cur_back]-a[cur_back] <= x[cur_back-1]:
    cur_back -= 1
while cur_front < n-1 and x[cur_front]+a[cur_front] >= x[cur_front+1]:
    cur_front += 1
print(cur_front-cur_back+1)
0