結果

問題 No.871 かえるのうた
ユーザー ttrttr
提出日時 2020-02-04 20:40:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 417 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 11,944 KB
実行使用メモリ 27,248 KB
最終ジャッジ日時 2023-10-21 06:33:40
合計ジャッジ時間 5,129 ms
ジャッジサーバーID
(参考情報)
judge13 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,180 KB
testcase_01 WA -
testcase_02 AC 29 ms
10,180 KB
testcase_03 WA -
testcase_04 AC 27 ms
10,184 KB
testcase_05 WA -
testcase_06 AC 28 ms
10,180 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 26 ms
10,288 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 202 ms
26,664 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 39 ms
11,572 KB
testcase_21 WA -
testcase_22 AC 26 ms
10,184 KB
testcase_23 WA -
testcase_24 AC 28 ms
10,180 KB
testcase_25 AC 32 ms
10,524 KB
testcase_26 AC 44 ms
11,472 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 179 ms
21,928 KB
testcase_31 WA -
testcase_32 AC 117 ms
20,436 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 100 ms
17,144 KB
testcase_38 AC 191 ms
26,104 KB
testcase_39 AC 144 ms
25,336 KB
testcase_40 WA -
testcase_41 AC 25 ms
10,180 KB
testcase_42 AC 151 ms
17,772 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 27 ms
10,180 KB
testcase_48 AC 27 ms
10,180 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int, input().split())
X = [int(x) for x in input().split()]
A = [int(a) for a in input().split()]

i = K-1
j = K-1
l = A[i]
r = A[j]
while True:
    flag = True
    l = min(l, X[i]-A[i], X[j]-A[j])
    r = max(r, X[i]+A[i], X[j]+A[j])
    if i > 0 and X[i-1] > l:
        i -= 1
        flag = False
    if j < N-1 and X[j+1] < r:
        j += 1
        flag = False
    if flag:
        break

print(j-i+1)
0