結果

問題 No.871 かえるのうた
ユーザー TakoKurageTakoKurage
提出日時 2019-08-30 21:42:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 388 bytes
コンパイル時間 240 ms
コンパイル使用メモリ 10,924 KB
実行使用メモリ 24,548 KB
最終ジャッジ日時 2023-08-14 04:17:17
合計ジャッジ時間 4,585 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,904 KB
testcase_01 WA -
testcase_02 AC 16 ms
7,800 KB
testcase_03 AC 15 ms
7,796 KB
testcase_04 AC 15 ms
7,740 KB
testcase_05 AC 16 ms
7,880 KB
testcase_06 WA -
testcase_07 AC 16 ms
7,800 KB
testcase_08 AC 17 ms
8,484 KB
testcase_09 AC 18 ms
8,788 KB
testcase_10 AC 16 ms
8,176 KB
testcase_11 AC 16 ms
8,456 KB
testcase_12 AC 28 ms
11,092 KB
testcase_13 AC 18 ms
8,856 KB
testcase_14 AC 85 ms
24,040 KB
testcase_15 AC 86 ms
24,136 KB
testcase_16 AC 156 ms
24,548 KB
testcase_17 AC 82 ms
22,680 KB
testcase_18 AC 27 ms
10,820 KB
testcase_19 WA -
testcase_20 AC 27 ms
9,528 KB
testcase_21 AC 53 ms
13,644 KB
testcase_22 AC 16 ms
7,848 KB
testcase_23 AC 16 ms
7,816 KB
testcase_24 AC 16 ms
7,952 KB
testcase_25 AC 18 ms
8,412 KB
testcase_26 AC 28 ms
9,548 KB
testcase_27 AC 25 ms
10,508 KB
testcase_28 AC 16 ms
7,848 KB
testcase_29 AC 49 ms
15,084 KB
testcase_30 AC 112 ms
20,052 KB
testcase_31 AC 17 ms
8,432 KB
testcase_32 AC 95 ms
18,384 KB
testcase_33 WA -
testcase_34 AC 32 ms
12,348 KB
testcase_35 AC 55 ms
18,004 KB
testcase_36 AC 70 ms
20,836 KB
testcase_37 AC 72 ms
15,092 KB
testcase_38 AC 141 ms
24,116 KB
testcase_39 WA -
testcase_40 AC 93 ms
15,720 KB
testcase_41 AC 15 ms
7,904 KB
testcase_42 AC 92 ms
15,724 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 16 ms
7,876 KB
testcase_47 AC 16 ms
7,956 KB
testcase_48 AC 16 ms
7,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = [int(i) for i in input().split()]
X = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]

ans = 1
cur = 1e50
for i in reversed(range(K - 1)):
    cur = min(cur, X[i + 1] - A[i + 1])
    if cur > X[i]:
        break
    ans += 1

cur = -1e50
for i in range(K, N):
    cur = max(cur, X[i - 1] + A[i - 1])
    if cur < X[i]:
        break
    ans += 1

print(ans)
0