結果

問題 No.871 かえるのうた
ユーザー brthyyjpbrthyyjp
提出日時 2020-06-09 14:39:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 495 bytes
コンパイル時間 498 ms
コンパイル使用メモリ 87,236 KB
実行使用メモリ 96,176 KB
最終ジャッジ日時 2023-08-30 12:24:02
合計ジャッジ時間 9,809 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,268 KB
testcase_01 WA -
testcase_02 AC 75 ms
71,472 KB
testcase_03 AC 75 ms
71,524 KB
testcase_04 AC 76 ms
71,328 KB
testcase_05 AC 76 ms
71,092 KB
testcase_06 AC 75 ms
71,264 KB
testcase_07 AC 77 ms
71,460 KB
testcase_08 AC 81 ms
75,656 KB
testcase_09 AC 80 ms
75,800 KB
testcase_10 AC 79 ms
75,796 KB
testcase_11 AC 84 ms
75,656 KB
testcase_12 AC 84 ms
77,864 KB
testcase_13 AC 78 ms
75,492 KB
testcase_14 AC 126 ms
93,800 KB
testcase_15 AC 125 ms
93,628 KB
testcase_16 AC 139 ms
95,468 KB
testcase_17 AC 124 ms
93,420 KB
testcase_18 AC 85 ms
78,260 KB
testcase_19 WA -
testcase_20 AC 85 ms
76,692 KB
testcase_21 AC 106 ms
86,408 KB
testcase_22 AC 75 ms
71,000 KB
testcase_23 AC 76 ms
71,176 KB
testcase_24 AC 74 ms
71,272 KB
testcase_25 AC 81 ms
76,056 KB
testcase_26 AC 87 ms
76,504 KB
testcase_27 AC 82 ms
76,048 KB
testcase_28 AC 75 ms
71,344 KB
testcase_29 AC 98 ms
93,304 KB
testcase_30 AC 117 ms
96,176 KB
testcase_31 AC 79 ms
75,580 KB
testcase_32 AC 115 ms
95,144 KB
testcase_33 AC 129 ms
94,288 KB
testcase_34 AC 86 ms
80,044 KB
testcase_35 AC 99 ms
92,704 KB
testcase_36 AC 112 ms
94,732 KB
testcase_37 AC 105 ms
88,064 KB
testcase_38 AC 128 ms
93,656 KB
testcase_39 WA -
testcase_40 AC 103 ms
93,584 KB
testcase_41 AC 74 ms
70,960 KB
testcase_42 AC 101 ms
93,432 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 74 ms
71,368 KB
testcase_47 AC 74 ms
71,368 KB
testcase_48 AC 74 ms
71,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
X = list(map(int, input().split()))
A = list(map(int, input().split()))

X.sort()

k -= 1

l = k
r = k
ld = X[k]-A[k]
rd = X[k]+A[k]

flag = True
while flag:
    flag = False
    while l-1 >= 0 and ld <= X[l-1]:
        flag = True
        l -= 1
        ld = min(ld, X[l]-A[l])
        rd = max(rd, X[l]+A[l])
    while r+1 <= n-1 and X[r+1] <= rd:
        flag = True
        r += 1
        rd = max(rd, X[r]+A[r])
        ld = min(ld, X[r]+A[r])
print(r-l+1)
0