結果

問題 No.871 かえるのうた
ユーザー titiatitia
提出日時 2019-08-30 22:00:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 338 bytes
コンパイル時間 328 ms
コンパイル使用メモリ 10,900 KB
実行使用メモリ 25,444 KB
最終ジャッジ日時 2023-08-14 05:01:29
合計ジャッジ時間 4,296 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,808 KB
testcase_01 WA -
testcase_02 AC 15 ms
7,876 KB
testcase_03 AC 15 ms
7,876 KB
testcase_04 AC 17 ms
7,812 KB
testcase_05 AC 16 ms
7,832 KB
testcase_06 WA -
testcase_07 AC 15 ms
7,800 KB
testcase_08 AC 17 ms
8,600 KB
testcase_09 AC 18 ms
8,732 KB
testcase_10 AC 16 ms
7,952 KB
testcase_11 AC 17 ms
8,268 KB
testcase_12 AC 29 ms
11,180 KB
testcase_13 AC 19 ms
8,852 KB
testcase_14 AC 93 ms
25,444 KB
testcase_15 AC 90 ms
25,404 KB
testcase_16 AC 144 ms
24,544 KB
testcase_17 AC 86 ms
22,692 KB
testcase_18 AC 29 ms
10,892 KB
testcase_19 WA -
testcase_20 AC 26 ms
9,524 KB
testcase_21 AC 50 ms
14,828 KB
testcase_22 AC 15 ms
7,744 KB
testcase_23 AC 15 ms
7,880 KB
testcase_24 AC 15 ms
7,916 KB
testcase_25 AC 18 ms
8,480 KB
testcase_26 AC 27 ms
9,396 KB
testcase_27 AC 26 ms
10,540 KB
testcase_28 AC 16 ms
7,804 KB
testcase_29 AC 52 ms
15,144 KB
testcase_30 AC 101 ms
20,040 KB
testcase_31 AC 17 ms
8,444 KB
testcase_32 AC 87 ms
18,492 KB
testcase_33 WA -
testcase_34 AC 34 ms
12,300 KB
testcase_35 AC 58 ms
17,976 KB
testcase_36 AC 76 ms
20,908 KB
testcase_37 AC 65 ms
15,096 KB
testcase_38 AC 131 ms
23,988 KB
testcase_39 WA -
testcase_40 AC 86 ms
15,708 KB
testcase_41 AC 15 ms
7,968 KB
testcase_42 AC 83 ms
15,740 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 15 ms
7,784 KB
testcase_47 AC 15 ms
7,792 KB
testcase_48 AC 15 ms
7,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

K-=1
ANS=1
PLUS=X[K]+A[K]
MINUS=X[K]-A[K]

for i in range(K+1,N):
    if X[i]<=PLUS:
        ANS+=1
        PLUS=max(PLUS,X[i]+A[i])

for i in range(K-1,-1,-1):
    if X[i]>=MINUS:
        ANS+=1
        MINUS=min(MINUS,X[i]-A[i])

print(ANS)
0