結果

問題 No.871 かえるのうた
ユーザー rlangevinrlangevin
提出日時 2023-01-18 00:58:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 518 bytes
コンパイル時間 722 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 113,792 KB
最終ジャッジ日時 2023-09-01 22:18:25
合計ジャッジ時間 10,978 ms
ジャッジサーバーID
(参考情報)
judge16 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,676 KB
testcase_01 AC 91 ms
71,608 KB
testcase_02 AC 92 ms
71,736 KB
testcase_03 AC 91 ms
71,688 KB
testcase_04 AC 91 ms
71,828 KB
testcase_05 AC 90 ms
71,608 KB
testcase_06 AC 91 ms
71,688 KB
testcase_07 AC 90 ms
71,412 KB
testcase_08 AC 103 ms
77,672 KB
testcase_09 AC 103 ms
77,812 KB
testcase_10 AC 98 ms
77,068 KB
testcase_11 AC 101 ms
77,780 KB
testcase_12 AC 106 ms
80,268 KB
testcase_13 AC 101 ms
77,864 KB
testcase_14 AC 156 ms
110,500 KB
testcase_15 AC 154 ms
110,488 KB
testcase_16 AC 187 ms
107,648 KB
testcase_17 AC 151 ms
113,696 KB
testcase_18 AC 107 ms
81,428 KB
testcase_19 AC 166 ms
110,556 KB
testcase_20 AC 110 ms
78,304 KB
testcase_21 AC 141 ms
89,816 KB
testcase_22 AC 92 ms
71,732 KB
testcase_23 AC 91 ms
71,780 KB
testcase_24 AC 92 ms
71,564 KB
testcase_25 AC 103 ms
77,828 KB
testcase_26 AC 107 ms
78,144 KB
testcase_27 AC 105 ms
78,888 KB
testcase_28 AC 89 ms
71,416 KB
testcase_29 AC 127 ms
99,444 KB
testcase_30 AC 152 ms
104,284 KB
testcase_31 AC 100 ms
77,800 KB
testcase_32 AC 153 ms
100,884 KB
testcase_33 AC 148 ms
113,016 KB
testcase_34 AC 109 ms
83,212 KB
testcase_35 AC 125 ms
97,788 KB
testcase_36 AC 146 ms
110,504 KB
testcase_37 AC 139 ms
91,984 KB
testcase_38 AC 170 ms
113,792 KB
testcase_39 AC 163 ms
110,448 KB
testcase_40 AC 140 ms
99,712 KB
testcase_41 AC 89 ms
71,572 KB
testcase_42 AC 127 ms
98,228 KB
testcase_43 AC 92 ms
71,692 KB
testcase_44 WA -
testcase_45 AC 101 ms
77,480 KB
testcase_46 AC 89 ms
71,756 KB
testcase_47 AC 91 ms
71,572 KB
testcase_48 AC 89 ms
71,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *

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]

Q = deque([K])
left = inf
right = -inf
for i in range(N):
    s = Q[0]
    left = min(left, X[s] - A[s])
    right = max(right, X[s] + A[s])
    if X[s - 1] >= left:
        Q.appendleft(s - 1)
    b = Q[-1]
    left = min(left, X[b] - A[b])
    right = max(right, X[b] + A[b])
    if X[b + 1] <= right:
        Q.append(b + 1)
print(len(Q))
0