結果

問題 No.871 かえるのうた
ユーザー convexineqconvexineq
提出日時 2021-04-08 11:04:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 404 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 81,900 KB
実行使用メモリ 101,280 KB
最終ジャッジ日時 2024-05-07 16:43:45
合計ジャッジ時間 4,602 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,352 KB
testcase_01 AC 33 ms
52,352 KB
testcase_02 AC 34 ms
51,968 KB
testcase_03 AC 35 ms
51,584 KB
testcase_04 AC 35 ms
51,712 KB
testcase_05 AC 34 ms
51,968 KB
testcase_06 AC 34 ms
51,712 KB
testcase_07 AC 34 ms
51,840 KB
testcase_08 AC 37 ms
59,008 KB
testcase_09 AC 38 ms
59,776 KB
testcase_10 AC 40 ms
58,368 KB
testcase_11 AC 38 ms
58,368 KB
testcase_12 AC 43 ms
68,224 KB
testcase_13 AC 37 ms
59,904 KB
testcase_14 AC 87 ms
95,744 KB
testcase_15 AC 86 ms
95,336 KB
testcase_16 AC 99 ms
96,300 KB
testcase_17 AC 85 ms
97,164 KB
testcase_18 AC 45 ms
69,712 KB
testcase_19 AC 94 ms
96,540 KB
testcase_20 AC 47 ms
67,768 KB
testcase_21 AC 73 ms
86,992 KB
testcase_22 AC 34 ms
52,224 KB
testcase_23 AC 34 ms
51,968 KB
testcase_24 AC 34 ms
52,224 KB
testcase_25 AC 41 ms
60,288 KB
testcase_26 AC 44 ms
64,384 KB
testcase_27 AC 41 ms
65,664 KB
testcase_28 AC 33 ms
51,968 KB
testcase_29 AC 62 ms
89,856 KB
testcase_30 AC 84 ms
101,280 KB
testcase_31 AC 38 ms
59,172 KB
testcase_32 AC 82 ms
97,572 KB
testcase_33 AC 87 ms
98,656 KB
testcase_34 AC 46 ms
73,372 KB
testcase_35 AC 65 ms
91,140 KB
testcase_36 AC 78 ms
100,224 KB
testcase_37 AC 70 ms
89,064 KB
testcase_38 AC 95 ms
97,280 KB
testcase_39 AC 91 ms
95,292 KB
testcase_40 AC 68 ms
92,472 KB
testcase_41 AC 35 ms
51,840 KB
testcase_42 AC 64 ms
89,856 KB
testcase_43 AC 33 ms
52,500 KB
testcase_44 AC 34 ms
52,560 KB
testcase_45 AC 40 ms
61,096 KB
testcase_46 AC 35 ms
53,348 KB
testcase_47 AC 34 ms
52,444 KB
testcase_48 AC 34 ms
53,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
INF = 10**18
x = [-INF] + list(map(int,input().split())) + [INF]
a = [0] + list(map(int,input().split())) + [0]
l = r = k
L,R = x[k]-a[k], x[k]+a[k]
while L <= x[l] or x[r] <= R:
    if L <= x[l]:
        L = min(L,x[l]-a[l])
        R = max(R,x[l]+a[l])
        l -= 1
    if x[r] <= R:
        L = min(L,x[r]-a[r])
        R = max(R,x[r]+a[r])
        r += 1
print(r-l-1)
0