結果

問題 No.871 かえるのうた
ユーザー shoooooshooooo
提出日時 2019-11-28 09:54:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 383 bytes
コンパイル時間 112 ms
コンパイル使用メモリ 10,808 KB
実行使用メモリ 24,564 KB
最終ジャッジ日時 2023-08-11 00:21:34
合計ジャッジ時間 5,006 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,676 KB
testcase_01 WA -
testcase_02 AC 15 ms
7,784 KB
testcase_03 AC 15 ms
7,816 KB
testcase_04 AC 15 ms
7,708 KB
testcase_05 AC 14 ms
7,776 KB
testcase_06 AC 14 ms
7,764 KB
testcase_07 AC 16 ms
7,808 KB
testcase_08 AC 16 ms
8,436 KB
testcase_09 AC 17 ms
8,716 KB
testcase_10 AC 16 ms
8,232 KB
testcase_11 AC 16 ms
8,200 KB
testcase_12 AC 26 ms
10,960 KB
testcase_13 AC 18 ms
8,760 KB
testcase_14 AC 77 ms
24,072 KB
testcase_15 AC 75 ms
23,988 KB
testcase_16 AC 214 ms
24,564 KB
testcase_17 AC 71 ms
22,656 KB
testcase_18 AC 25 ms
10,884 KB
testcase_19 WA -
testcase_20 AC 33 ms
9,520 KB
testcase_21 AC 60 ms
14,352 KB
testcase_22 AC 15 ms
7,712 KB
testcase_23 AC 15 ms
7,772 KB
testcase_24 AC 14 ms
7,828 KB
testcase_25 AC 19 ms
8,332 KB
testcase_26 AC 33 ms
9,376 KB
testcase_27 AC 23 ms
10,432 KB
testcase_28 AC 16 ms
7,760 KB
testcase_29 AC 42 ms
15,036 KB
testcase_30 AC 155 ms
20,060 KB
testcase_31 AC 16 ms
8,396 KB
testcase_32 AC 122 ms
18,372 KB
testcase_33 AC 74 ms
23,980 KB
testcase_34 AC 29 ms
12,084 KB
testcase_35 AC 48 ms
17,928 KB
testcase_36 AC 61 ms
20,896 KB
testcase_37 AC 94 ms
15,168 KB
testcase_38 AC 194 ms
23,952 KB
testcase_39 WA -
testcase_40 AC 134 ms
15,656 KB
testcase_41 AC 15 ms
7,772 KB
testcase_42 AC 133 ms
15,828 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 15 ms
7,776 KB
testcase_47 AC 15 ms
7,828 KB
testcase_48 AC 15 ms
7,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
r=list(map(int,input().split()))
A=list(map(int,input().split()))
K-=1
left=r[K]-A[K]
right=r[K]+A[K]
K1=K
while K1-1>=0 and left<=r[K1-1]<=right:
  left=min(r[K1-1]-A[K1-1],left)
  right=max(r[K1-1]+A[K1-1],right)
  K1-=1
  low=K1
while K+1<=N-1 and r[K+1]<=right:
  right=max(r[K+1]+A[K+1],right)
  left=min(r[K+1]-A[K-1],left)
  K+=1
print(K-K1+1) 
  
0