結果
| 問題 |
No.871 かえるのうた
|
| コンテスト | |
| ユーザー |
shooooo
|
| 提出日時 | 2019-11-28 10:05:21 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 263 ms / 2,000 ms |
| コード長 | 465 bytes |
| コンパイル時間 | 166 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 28,988 KB |
| 最終ジャッジ日時 | 2024-11-30 10:58:17 |
| 合計ジャッジ時間 | 5,251 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 49 |
ソースコード
N,K=map(int,input().split())
r=list(map(int,input().split()))
A=list(map(int,input().split()))
K-=1
left=r[K]-A[K]
right=r[K]+A[K]
updated=True
K1=K
while updated:
updated=False
while K1-1>=0 and left<=r[K1-1]<=right:
updated=True
left=min(r[K1-1]-A[K1-1],left)
right=max(r[K1-1]+A[K1-1],right)
K1-=1
while K+1<=N-1 and r[K+1]<=right:
updated=True
right=max(r[K+1]+A[K+1],right)
left=min(r[K+1]-A[K+1],left)
K+=1
print(K-K1+1)
shooooo