結果
問題 | No.871 かえるのうた |
ユーザー |
![]() |
提出日時 | 2021-04-08 11:34:59 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 125 ms / 2,000 ms |
コード長 | 341 bytes |
コンパイル時間 | 180 ms |
コンパイル使用メモリ | 82,688 KB |
実行使用メモリ | 101,248 KB |
最終ジャッジ日時 | 2024-11-30 11:06:21 |
合計ジャッジ時間 | 5,005 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 49 |
ソースコード
n,k = input().split() x = [-2**60] + list(map(int,input().split())) + [2**60] a = [0] + list(map(int,input().split())) + [0] l = r = int(k) L,R = x[r]-a[r], x[r]+a[r] while L <= x[l] or x[r] <= R: if L <= x[l]: L,R,l = min(L,x[l]-a[l]), max(R,x[l]+a[l]), l-1 if x[r] <= R: L,R,r = min(L,x[r]-a[r]), max(R,x[r]+a[r]), r+1 print(r-l-1)