結果
問題 | No.871 かえるのうた |
ユーザー |
![]() |
提出日時 | 2019-08-31 21:55:29 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 454 bytes |
コンパイル時間 | 90 ms |
コンパイル使用メモリ | 12,288 KB |
実行使用メモリ | 28,128 KB |
最終ジャッジ日時 | 2024-11-25 09:05:08 |
合計ジャッジ時間 | 4,155 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 41 WA * 8 |
ソースコード
N,K=map(int,input().split()) P=list(map(int,input().split())) INF=float('inf') P=[-INF]+P+[INF] A=list(map(int,input().split())) A=[0]+A+[0] L=P[K]-A[K] R=P[K]+A[K] for i in range(10**5+5): if L<=P[K-i]: if L>P[K-i]-A[K-i]: L=P[K-i]-A[K-i] else: break #print(i) for j in range(10**5+5): if R>=P[K+j]: if R<P[K+j]+A[K+j]: R=P[K+j]+A[K+j] else: break #print(j) print(max(i+j-1,1))