結果

問題 No.871 かえるのうた
ユーザー shoooooshooooo
提出日時 2019-11-28 09:54:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 383 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 28,844 KB
最終ジャッジ日時 2024-04-28 17:30:39
合計ジャッジ時間 6,442 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,752 KB
testcase_01 WA -
testcase_02 AC 30 ms
10,624 KB
testcase_03 AC 32 ms
10,752 KB
testcase_04 AC 31 ms
10,752 KB
testcase_05 AC 31 ms
10,752 KB
testcase_06 AC 30 ms
10,624 KB
testcase_07 AC 30 ms
10,752 KB
testcase_08 AC 32 ms
11,264 KB
testcase_09 AC 32 ms
11,392 KB
testcase_10 AC 31 ms
10,880 KB
testcase_11 AC 31 ms
11,008 KB
testcase_12 AC 44 ms
13,568 KB
testcase_13 AC 33 ms
11,264 KB
testcase_14 AC 104 ms
27,832 KB
testcase_15 AC 103 ms
27,928 KB
testcase_16 AC 264 ms
28,844 KB
testcase_17 AC 100 ms
26,352 KB
testcase_18 AC 43 ms
13,268 KB
testcase_19 WA -
testcase_20 AC 49 ms
12,052 KB
testcase_21 AC 81 ms
16,248 KB
testcase_22 AC 29 ms
10,624 KB
testcase_23 AC 30 ms
10,752 KB
testcase_24 AC 30 ms
10,624 KB
testcase_25 AC 34 ms
10,880 KB
testcase_26 AC 52 ms
11,904 KB
testcase_27 AC 40 ms
12,800 KB
testcase_28 AC 30 ms
10,752 KB
testcase_29 AC 63 ms
17,696 KB
testcase_30 AC 198 ms
22,736 KB
testcase_31 AC 32 ms
11,136 KB
testcase_32 AC 156 ms
20,008 KB
testcase_33 AC 101 ms
25,640 KB
testcase_34 AC 48 ms
14,832 KB
testcase_35 AC 72 ms
19,320 KB
testcase_36 AC 86 ms
22,320 KB
testcase_37 AC 127 ms
17,292 KB
testcase_38 AC 242 ms
25,720 KB
testcase_39 WA -
testcase_40 AC 168 ms
17,808 KB
testcase_41 AC 30 ms
10,752 KB
testcase_42 AC 168 ms
17,936 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 30 ms
10,624 KB
testcase_47 AC 30 ms
10,752 KB
testcase_48 AC 31 ms
10,880 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