結果

問題 No.871 かえるのうた
ユーザー convexineqconvexineq
提出日時 2021-04-08 11:04:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 145 ms / 2,000 ms
コード長 404 bytes
コンパイル時間 419 ms
コンパイル使用メモリ 86,708 KB
実行使用メモリ 98,296 KB
最終ジャッジ日時 2023-08-20 09:39:33
合計ジャッジ時間 8,158 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,308 KB
testcase_01 AC 91 ms
71,016 KB
testcase_02 AC 89 ms
71,332 KB
testcase_03 AC 91 ms
71,276 KB
testcase_04 AC 91 ms
71,468 KB
testcase_05 AC 91 ms
71,236 KB
testcase_06 AC 90 ms
71,168 KB
testcase_07 AC 89 ms
71,420 KB
testcase_08 AC 87 ms
75,756 KB
testcase_09 AC 79 ms
75,588 KB
testcase_10 AC 78 ms
75,640 KB
testcase_11 AC 77 ms
75,624 KB
testcase_12 AC 83 ms
78,708 KB
testcase_13 AC 77 ms
75,804 KB
testcase_14 AC 130 ms
96,032 KB
testcase_15 AC 133 ms
95,904 KB
testcase_16 AC 145 ms
97,760 KB
testcase_17 AC 126 ms
95,628 KB
testcase_18 AC 84 ms
79,480 KB
testcase_19 AC 139 ms
97,656 KB
testcase_20 AC 87 ms
76,684 KB
testcase_21 AC 112 ms
88,364 KB
testcase_22 AC 75 ms
71,108 KB
testcase_23 AC 75 ms
71,164 KB
testcase_24 AC 75 ms
71,124 KB
testcase_25 AC 82 ms
76,380 KB
testcase_26 AC 84 ms
76,352 KB
testcase_27 AC 80 ms
76,716 KB
testcase_28 AC 74 ms
71,392 KB
testcase_29 AC 103 ms
96,340 KB
testcase_30 AC 123 ms
97,860 KB
testcase_31 AC 77 ms
75,764 KB
testcase_32 AC 120 ms
98,296 KB
testcase_33 AC 126 ms
96,764 KB
testcase_34 AC 87 ms
81,572 KB
testcase_35 AC 111 ms
95,676 KB
testcase_36 AC 118 ms
96,612 KB
testcase_37 AC 114 ms
90,080 KB
testcase_38 AC 141 ms
96,060 KB
testcase_39 AC 134 ms
95,000 KB
testcase_40 AC 105 ms
96,836 KB
testcase_41 AC 74 ms
71,256 KB
testcase_42 AC 105 ms
96,556 KB
testcase_43 AC 74 ms
71,128 KB
testcase_44 AC 73 ms
71,272 KB
testcase_45 AC 81 ms
76,452 KB
testcase_46 AC 74 ms
71,272 KB
testcase_47 AC 75 ms
71,352 KB
testcase_48 AC 74 ms
71,432 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