結果

問題 No.871 かえるのうた
ユーザー anagohirameanagohirame
提出日時 2019-08-30 22:48:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 28,356 KB
最終ジャッジ日時 2024-05-01 19:36:04
合計ジャッジ時間 5,515 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,752 KB
testcase_01 WA -
testcase_02 AC 29 ms
10,880 KB
testcase_03 AC 30 ms
10,752 KB
testcase_04 AC 29 ms
10,752 KB
testcase_05 AC 29 ms
10,880 KB
testcase_06 WA -
testcase_07 AC 29 ms
10,752 KB
testcase_08 AC 30 ms
11,136 KB
testcase_09 AC 31 ms
11,136 KB
testcase_10 AC 29 ms
10,752 KB
testcase_11 AC 30 ms
10,880 KB
testcase_12 AC 41 ms
13,312 KB
testcase_13 AC 32 ms
11,392 KB
testcase_14 AC 102 ms
26,576 KB
testcase_15 AC 102 ms
28,068 KB
testcase_16 AC 183 ms
27,196 KB
testcase_17 AC 96 ms
25,428 KB
testcase_18 AC 40 ms
13,208 KB
testcase_19 WA -
testcase_20 AC 41 ms
12,044 KB
testcase_21 AC 68 ms
16,292 KB
testcase_22 AC 29 ms
10,752 KB
testcase_23 AC 29 ms
10,752 KB
testcase_24 AC 28 ms
10,752 KB
testcase_25 AC 32 ms
11,008 KB
testcase_26 AC 42 ms
12,032 KB
testcase_27 AC 38 ms
12,800 KB
testcase_28 AC 29 ms
10,752 KB
testcase_29 AC 65 ms
17,824 KB
testcase_30 AC 134 ms
22,684 KB
testcase_31 AC 32 ms
11,136 KB
testcase_32 AC 114 ms
20,524 KB
testcase_33 WA -
testcase_34 AC 46 ms
14,792 KB
testcase_35 AC 71 ms
19,584 KB
testcase_36 AC 83 ms
21,952 KB
testcase_37 AC 88 ms
17,792 KB
testcase_38 AC 169 ms
26,876 KB
testcase_39 WA -
testcase_40 AC 115 ms
17,452 KB
testcase_41 AC 30 ms
10,752 KB
testcase_42 AC 117 ms
17,452 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 29 ms
10,752 KB
testcase_47 AC 28 ms
10,752 KB
testcase_48 AC 28 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
x = list(map(int, input().split()))
a = list(map(int, input().split()))
cur_back, cur_front = k-1, k-1
lm, rm = x[k-1]-a[k-1], x[k-1]+a[k-1]
while cur_back > 0 and lm <= x[cur_back-1]:
    cur_back -= 1
    lm = min(lm, x[cur_back]-a[cur_back])
while cur_front < n-1 and rm >= x[cur_front+1]:
    cur_front += 1
    rm = max(rm, x[cur_front]+a[cur_front])
print(cur_front-cur_back+1)
0