結果

問題 No.871 かえるのうた
ユーザー timi
提出日時 2021-01-05 16:42:12
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 315 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 28,408 KB
最終ジャッジ日時 2024-11-06 03:00:46
合計ジャッジ時間 5,591 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int, input().split())
A=list(map(int, input().split()))
B=list(map(int, input().split()))
if N==1:
  print(1)
  exit()
ans=1
r=K-1
while r<N-1:
  d=A[r+1]-A[r]
  if d<=B[r]:
    ans+=1
    r+=1
  else:
    break
l=K-1
while 0<l:
  d=A[l]-A[l-1]
  if d<=B[l]:
    ans+=1
    l-=1
  else:
    break
print(ans)
0