結果

問題 No.871 かえるのうた
ユーザー NoneNone
提出日時 2021-03-12 14:02:08
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 369 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 82,532 KB
実行使用メモリ 98,816 KB
最終ジャッジ日時 2024-04-22 01:40:21
合計ジャッジ時間 5,226 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
52,480 KB
testcase_01 AC 31 ms
52,224 KB
testcase_02 AC 38 ms
52,188 KB
testcase_03 AC 40 ms
51,968 KB
testcase_04 RE -
testcase_05 AC 32 ms
51,840 KB
testcase_06 AC 32 ms
51,968 KB
testcase_07 AC 34 ms
52,480 KB
testcase_08 AC 36 ms
59,264 KB
testcase_09 AC 35 ms
59,392 KB
testcase_10 RE -
testcase_11 AC 34 ms
58,496 KB
testcase_12 AC 40 ms
67,328 KB
testcase_13 AC 37 ms
59,904 KB
testcase_14 AC 81 ms
93,568 KB
testcase_15 AC 82 ms
93,440 KB
testcase_16 WA -
testcase_17 AC 79 ms
95,064 KB
testcase_18 AC 41 ms
67,968 KB
testcase_19 AC 90 ms
94,164 KB
testcase_20 WA -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 31 ms
52,480 KB
testcase_24 AC 32 ms
51,968 KB
testcase_25 AC 38 ms
61,232 KB
testcase_26 AC 42 ms
64,384 KB
testcase_27 AC 39 ms
65,152 KB
testcase_28 AC 32 ms
51,968 KB
testcase_29 AC 56 ms
86,912 KB
testcase_30 AC 77 ms
97,804 KB
testcase_31 AC 35 ms
59,136 KB
testcase_32 AC 74 ms
94,916 KB
testcase_33 AC 75 ms
96,128 KB
testcase_34 AC 43 ms
70,400 KB
testcase_35 AC 57 ms
88,704 KB
testcase_36 AC 69 ms
98,816 KB
testcase_37 AC 66 ms
86,860 KB
testcase_38 AC 88 ms
94,976 KB
testcase_39 AC 82 ms
93,356 KB
testcase_40 RE -
testcase_41 AC 32 ms
52,480 KB
testcase_42 WA -
testcase_43 AC 33 ms
51,968 KB
testcase_44 AC 32 ms
51,968 KB
testcase_45 RE -
testcase_46 AC 34 ms
51,968 KB
testcase_47 AC 32 ms
51,968 KB
testcase_48 AC 31 ms
52,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

l,r=K-1,K-1
L,R=X[l]-A[l],X[r]+A[r]
while (r+1<N and X[r+1]<=R) or (l>0 and X[l-1]>=L):
    if X[r+1]<=R:
        r+=1
        R=max(X[r]+A[r],R)
        L=min(X[r]-A[r],L)
    if X[l-1]>=L:
        l-=1
        R=max(X[l]+A[l],R)
        L=min(X[l]-A[l],L)
print(r-l+1)
0