結果

問題 No.871 かえるのうた
ユーザー ああいいああいい
提出日時 2022-04-19 18:47:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 439 bytes
コンパイル時間 335 ms
コンパイル使用メモリ 87,272 KB
実行使用メモリ 95,768 KB
最終ジャッジ日時 2023-08-30 17:00:01
合計ジャッジ時間 6,586 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,164 KB
testcase_01 WA -
testcase_02 AC 66 ms
71,248 KB
testcase_03 AC 65 ms
71,320 KB
testcase_04 AC 65 ms
71,140 KB
testcase_05 AC 67 ms
71,028 KB
testcase_06 AC 67 ms
71,308 KB
testcase_07 AC 67 ms
71,256 KB
testcase_08 AC 70 ms
75,444 KB
testcase_09 AC 70 ms
75,396 KB
testcase_10 AC 71 ms
75,516 KB
testcase_11 AC 70 ms
75,512 KB
testcase_12 AC 74 ms
77,776 KB
testcase_13 AC 71 ms
75,376 KB
testcase_14 AC 113 ms
93,672 KB
testcase_15 AC 114 ms
93,668 KB
testcase_16 AC 129 ms
95,480 KB
testcase_17 AC 108 ms
93,280 KB
testcase_18 AC 74 ms
78,220 KB
testcase_19 WA -
testcase_20 AC 79 ms
76,432 KB
testcase_21 AC 101 ms
86,520 KB
testcase_22 AC 66 ms
71,232 KB
testcase_23 AC 67 ms
71,252 KB
testcase_24 AC 67 ms
71,328 KB
testcase_25 AC 78 ms
76,012 KB
testcase_26 AC 82 ms
76,100 KB
testcase_27 AC 77 ms
76,184 KB
testcase_28 AC 71 ms
71,336 KB
testcase_29 AC 95 ms
92,972 KB
testcase_30 AC 118 ms
95,768 KB
testcase_31 AC 75 ms
75,504 KB
testcase_32 AC 115 ms
95,012 KB
testcase_33 AC 115 ms
94,232 KB
testcase_34 AC 76 ms
79,816 KB
testcase_35 AC 93 ms
92,596 KB
testcase_36 AC 105 ms
94,580 KB
testcase_37 AC 101 ms
88,100 KB
testcase_38 AC 123 ms
93,932 KB
testcase_39 WA -
testcase_40 AC 100 ms
93,836 KB
testcase_41 AC 67 ms
71,240 KB
testcase_42 AC 92 ms
93,396 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 65 ms
70,980 KB
testcase_47 AC 67 ms
71,192 KB
testcase_48 AC 65 ms
71,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
X = list(map(int,input().split()))
A = list(map(int,input().split()))
K -= 1

migi = X[K] + A[K]
hidari = X[K] - A[K]
stack = [(K,1),(K,-1)]
ans = 1
while stack:
    now,d = stack.pop()
    if 0 <= now + d < N and hidari <= X[now + d] <= migi:
        migi = max(migi,X[now + d] + A[now + d])
        hidari = min(hidari,X[now + d] - A[now + d])
        stack.append((now + d,d))
        ans += 1
print(ans)
0