結果

問題 No.871 かえるのうた
ユーザー hir355hir355
提出日時 2020-04-03 17:57:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 369 bytes
コンパイル時間 834 ms
コンパイル使用メモリ 10,784 KB
実行使用メモリ 26,148 KB
最終ジャッジ日時 2023-09-15 23:47:45
合計ジャッジ時間 7,658 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,880 KB
testcase_01 WA -
testcase_02 AC 16 ms
7,812 KB
testcase_03 AC 16 ms
7,720 KB
testcase_04 AC 15 ms
7,812 KB
testcase_05 AC 16 ms
7,776 KB
testcase_06 WA -
testcase_07 AC 15 ms
7,784 KB
testcase_08 AC 17 ms
8,544 KB
testcase_09 AC 18 ms
8,604 KB
testcase_10 AC 16 ms
7,796 KB
testcase_11 AC 17 ms
8,252 KB
testcase_12 AC 27 ms
11,184 KB
testcase_13 AC 19 ms
8,848 KB
testcase_14 AC 83 ms
24,132 KB
testcase_15 AC 80 ms
24,080 KB
testcase_16 AC 143 ms
26,148 KB
testcase_17 AC 77 ms
22,608 KB
testcase_18 AC 26 ms
10,928 KB
testcase_19 WA -
testcase_20 AC 27 ms
9,536 KB
testcase_21 AC 49 ms
14,864 KB
testcase_22 AC 15 ms
7,904 KB
testcase_23 AC 16 ms
7,808 KB
testcase_24 AC 16 ms
7,756 KB
testcase_25 AC 18 ms
8,436 KB
testcase_26 AC 27 ms
9,416 KB
testcase_27 AC 24 ms
10,580 KB
testcase_28 AC 15 ms
7,888 KB
testcase_29 AC 46 ms
15,048 KB
testcase_30 AC 106 ms
20,080 KB
testcase_31 AC 17 ms
8,440 KB
testcase_32 AC 89 ms
18,480 KB
testcase_33 WA -
testcase_34 AC 31 ms
12,116 KB
testcase_35 AC 51 ms
17,996 KB
testcase_36 AC 66 ms
20,620 KB
testcase_37 AC 66 ms
15,088 KB
testcase_38 AC 134 ms
24,064 KB
testcase_39 WA -
testcase_40 AC 88 ms
15,760 KB
testcase_41 AC 16 ms
7,812 KB
testcase_42 AC 87 ms
15,728 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 16 ms
7,776 KB
testcase_47 AC 16 ms
7,772 KB
testcase_48 AC 15 ms
7,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
x = list(map(int, input().split()))
a = list(map(int, input().split()))
ans = 1
t = x[k - 1] - a[k - 1]
for i in range(k - 2, -1, -1):
    if t > x[i]:
        break
    t = min(t, x[i] - a[i])
    ans += 1
t = x[k - 1] + a[k - 1]
for i in range(k, n):
    if t < x[i]:
        break
    t = max(t, x[i] + a[i])
    ans += 1
print(ans)
0