結果
| 問題 |
No.871 かえるのうた
|
| コンテスト | |
| ユーザー |
anagohirame
|
| 提出日時 | 2019-08-30 22:47:11 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 416 bytes |
| コンパイル時間 | 184 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 28,236 KB |
| 最終ジャッジ日時 | 2024-11-22 01:44:04 |
| 合計ジャッジ時間 | 4,295 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 49 |
ソースコード
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
lm, rm = x[k-1]-a[k-1], x[l-1]+a[k-1]
while cur_back > 0 and lm <= x[cur_back-1]:
cur_back -= 1
lm = min(lm, x[cur_back]-a[cur_back])
while cur_front < n-1 and rm >= x[cur_front+1]:
cur_front += 1
rm = max(rm, x[cur_front]+a[cur_front])
print(cur_front-cur_back+1)
anagohirame