結果

問題 No.871 かえるのうた
ユーザー O2MTO2MT
提出日時 2020-08-24 12:45:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 548 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 98,380 KB
最終ジャッジ日時 2024-04-24 03:25:25
合計ジャッジ時間 4,815 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 39 ms
51,968 KB
testcase_04 AC 38 ms
52,480 KB
testcase_05 AC 38 ms
52,096 KB
testcase_06 AC 39 ms
51,584 KB
testcase_07 AC 39 ms
52,096 KB
testcase_08 AC 42 ms
58,880 KB
testcase_09 AC 44 ms
59,520 KB
testcase_10 AC 42 ms
58,368 KB
testcase_11 AC 43 ms
58,368 KB
testcase_12 AC 50 ms
67,712 KB
testcase_13 AC 43 ms
59,904 KB
testcase_14 AC 96 ms
93,092 KB
testcase_15 AC 95 ms
93,396 KB
testcase_16 AC 106 ms
94,412 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 102 ms
93,712 KB
testcase_20 AC 52 ms
64,952 KB
testcase_21 AC 76 ms
85,384 KB
testcase_22 AC 39 ms
52,488 KB
testcase_23 WA -
testcase_24 AC 40 ms
52,372 KB
testcase_25 AC 46 ms
61,336 KB
testcase_26 AC 50 ms
64,084 KB
testcase_27 AC 47 ms
64,384 KB
testcase_28 AC 40 ms
52,224 KB
testcase_29 WA -
testcase_30 AC 89 ms
97,604 KB
testcase_31 WA -
testcase_32 AC 85 ms
94,940 KB
testcase_33 AC 93 ms
96,120 KB
testcase_34 WA -
testcase_35 AC 70 ms
88,320 KB
testcase_36 WA -
testcase_37 AC 73 ms
85,884 KB
testcase_38 AC 98 ms
94,848 KB
testcase_39 AC 99 ms
93,652 KB
testcase_40 WA -
testcase_41 AC 39 ms
52,392 KB
testcase_42 AC 68 ms
87,164 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 41 ms
52,224 KB
testcase_47 AC 39 ms
51,840 KB
testcase_48 AC 41 ms
51,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
X = list(map(int,input().split()))
A = list(map(int,input().split()))
kukan = [X[K-1]-A[K-1], X[K-1]+A[K-1]]
l = r = K
if N == 1:
  print(1)
  exit()
flg = True
while flg:
  flg = False
  while l >= 1 and kukan[0] <= X[l-1] <= kukan[1]:
    l-=1
    kukan[0] = min(kukan[0], X[l]-A[l])
    kukan[1] = max(kukan[1], X[l]+A[l])
    flg = True
  while r <= N-2 and kukan[0] <= X[r+1] <= kukan[1]:
    r+=1
    kukan[0] = min(kukan[0], X[r]-A[r])
    kukan[1] = max(kukan[1], X[r]+A[r])
    flg = True
print(r-l+1)
      
0