結果

問題 No.871 かえるのうた
ユーザー 👑 rin204rin204
提出日時 2022-01-19 00:26:47
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 427 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 99,968 KB
最終ジャッジ日時 2024-05-02 19:39:12
合計ジャッジ時間 5,584 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,352 KB
testcase_01 WA -
testcase_02 AC 34 ms
52,224 KB
testcase_03 AC 35 ms
51,968 KB
testcase_04 AC 36 ms
52,480 KB
testcase_05 AC 34 ms
51,712 KB
testcase_06 WA -
testcase_07 AC 37 ms
51,712 KB
testcase_08 AC 40 ms
59,008 KB
testcase_09 AC 39 ms
59,520 KB
testcase_10 AC 40 ms
57,728 KB
testcase_11 AC 39 ms
58,624 KB
testcase_12 AC 47 ms
68,736 KB
testcase_13 AC 41 ms
60,160 KB
testcase_14 AC 99 ms
97,920 KB
testcase_15 AC 99 ms
97,408 KB
testcase_16 AC 106 ms
98,444 KB
testcase_17 AC 96 ms
97,024 KB
testcase_18 AC 50 ms
69,120 KB
testcase_19 WA -
testcase_20 AC 48 ms
64,896 KB
testcase_21 AC 70 ms
85,888 KB
testcase_22 AC 34 ms
51,712 KB
testcase_23 AC 34 ms
52,224 KB
testcase_24 AC 33 ms
52,224 KB
testcase_25 AC 40 ms
60,416 KB
testcase_26 AC 45 ms
64,384 KB
testcase_27 AC 46 ms
65,664 KB
testcase_28 AC 36 ms
51,968 KB
testcase_29 AC 69 ms
91,392 KB
testcase_30 AC 91 ms
99,968 KB
testcase_31 AC 41 ms
59,136 KB
testcase_32 AC 86 ms
99,456 KB
testcase_33 WA -
testcase_34 AC 52 ms
72,576 KB
testcase_35 AC 71 ms
92,416 KB
testcase_36 AC 86 ms
99,200 KB
testcase_37 AC 70 ms
87,040 KB
testcase_38 AC 100 ms
96,640 KB
testcase_39 WA -
testcase_40 AC 74 ms
92,800 KB
testcase_41 AC 34 ms
51,968 KB
testcase_42 AC 68 ms
91,520 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 35 ms
51,712 KB
testcase_47 AC 35 ms
51,712 KB
testcase_48 AC 36 ms
51,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
X = [-10 ** 20] + list(map(int, input().split())) + [10 ** 20]
A = [0] + list(map(int, input().split())) + [0]

ans = 1
min_ = X[k] - A[k]
for i in range(k - 1, -1, -1):
    if X[i] < min_:
        break
    ans += 1
    min_ = min(min_, X[i] - A[i])

max_ = X[k] + A[k]
for i in range(k + 1, n + 2):
    if X[i] > max_:
        break
    ans += 1
    max_ = max(max_, X[i] + A[i])

print(ans)
0