結果

問題 No.871 かえるのうた
ユーザー daku9640daku9640
提出日時 2019-08-30 22:37:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 657 bytes
コンパイル時間 113 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 29,920 KB
最終ジャッジ日時 2024-05-01 19:05:18
合計ジャッジ時間 4,854 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
10,752 KB
testcase_01 WA -
testcase_02 AC 31 ms
10,880 KB
testcase_03 AC 33 ms
10,752 KB
testcase_04 AC 32 ms
10,752 KB
testcase_05 AC 32 ms
10,752 KB
testcase_06 WA -
testcase_07 AC 31 ms
10,752 KB
testcase_08 AC 34 ms
11,136 KB
testcase_09 AC 34 ms
11,392 KB
testcase_10 AC 32 ms
10,880 KB
testcase_11 AC 32 ms
11,008 KB
testcase_12 AC 47 ms
13,952 KB
testcase_13 AC 35 ms
11,520 KB
testcase_14 AC 127 ms
29,672 KB
testcase_15 AC 124 ms
29,728 KB
testcase_16 AC 136 ms
28,316 KB
testcase_17 AC 123 ms
28,116 KB
testcase_18 AC 46 ms
13,620 KB
testcase_19 WA -
testcase_20 AC 40 ms
12,472 KB
testcase_21 AC 70 ms
17,312 KB
testcase_22 AC 31 ms
10,752 KB
testcase_23 AC 30 ms
10,752 KB
testcase_24 AC 31 ms
10,752 KB
testcase_25 AC 34 ms
11,136 KB
testcase_26 AC 40 ms
12,288 KB
testcase_27 AC 44 ms
13,312 KB
testcase_28 AC 30 ms
10,752 KB
testcase_29 AC 77 ms
19,040 KB
testcase_30 AC 107 ms
24,176 KB
testcase_31 AC 33 ms
11,264 KB
testcase_32 AC 96 ms
22,992 KB
testcase_33 WA -
testcase_34 AC 54 ms
15,508 KB
testcase_35 AC 86 ms
21,796 KB
testcase_36 AC 104 ms
25,700 KB
testcase_37 AC 72 ms
18,224 KB
testcase_38 AC 126 ms
28,524 KB
testcase_39 WA -
testcase_40 AC 197 ms
19,616 KB
testcase_41 AC 31 ms
10,880 KB
testcase_42 AC 85 ms
20,768 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 31 ms
10,752 KB
testcase_47 AC 31 ms
10,880 KB
testcase_48 AC 30 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left, bisect, insort_left, insort
def solve():
    n, k = map(int, input().split())
    k -= 1
    X = list(map(int, input().split()))
    A = list(map(int, input().split()))
    L = [X[i] - A[i] for i in range(n)]
    R = [X[i] + A[i] for i in range(n)]
    l = r = k
    flg = True
    min_x, max_x = L[k], R[k]
    while flg:
        flg = False
        lt = bisect_left(X, min_x)
        rt = bisect(X, max_x) - 1
        min_x = min([min_x] + L[lt:l + 1] + R[r :rt + 1])
        max_x = max([max_x] + L[lt:l + 1] + R[r :rt + 1])
        if l != lt or r != rt:
            l, r, flg = lt, rt, True
    print(r - l + 1)
solve()
0