結果

問題 No.871 かえるのうた
ユーザー vwxyzvwxyz
提出日時 2024-04-09 10:10:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 334 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 28,848 KB
最終ジャッジ日時 2024-04-09 10:10:24
合計ジャッジ時間 5,624 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,752 KB
testcase_01 AC 29 ms
10,752 KB
testcase_02 AC 30 ms
10,880 KB
testcase_03 AC 29 ms
10,752 KB
testcase_04 AC 28 ms
10,752 KB
testcase_05 AC 28 ms
10,624 KB
testcase_06 AC 27 ms
10,880 KB
testcase_07 AC 26 ms
10,624 KB
testcase_08 AC 32 ms
11,136 KB
testcase_09 AC 31 ms
11,392 KB
testcase_10 AC 47 ms
10,624 KB
testcase_11 AC 32 ms
10,880 KB
testcase_12 AC 39 ms
13,568 KB
testcase_13 AC 30 ms
11,520 KB
testcase_14 AC 94 ms
27,852 KB
testcase_15 AC 96 ms
27,940 KB
testcase_16 AC 221 ms
28,848 KB
testcase_17 AC 90 ms
26,480 KB
testcase_18 AC 37 ms
13,324 KB
testcase_19 AC 100 ms
28,228 KB
testcase_20 AC 43 ms
11,928 KB
testcase_21 AC 76 ms
17,068 KB
testcase_22 AC 27 ms
10,624 KB
testcase_23 AC 27 ms
10,624 KB
testcase_24 AC 27 ms
10,880 KB
testcase_25 AC 33 ms
11,136 KB
testcase_26 AC 48 ms
12,032 KB
testcase_27 AC 40 ms
12,928 KB
testcase_28 AC 28 ms
10,752 KB
testcase_29 AC 66 ms
17,700 KB
testcase_30 AC 182 ms
22,740 KB
testcase_31 AC 28 ms
11,264 KB
testcase_32 AC 145 ms
21,160 KB
testcase_33 AC 92 ms
26,608 KB
testcase_34 AC 44 ms
14,964 KB
testcase_35 AC 67 ms
20,060 KB
testcase_36 AC 79 ms
22,312 KB
testcase_37 AC 111 ms
17,296 KB
testcase_38 AC 216 ms
26,996 KB
testcase_39 AC 203 ms
25,828 KB
testcase_40 WA -
testcase_41 AC 28 ms
10,624 KB
testcase_42 AC 143 ms
17,812 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 27 ms
10,624 KB
testcase_47 AC 27 ms
10,880 KB
testcase_48 AC 26 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
K-=1
X=list(map(int,input().split()))
A=list(map(int,input().split()))
l=K
r=K+1
mi,ma=X[K]-A[K],X[K]+A[K]+1
while l and mi<=X[l-1] or r<N and X[r]<ma:
	if l and mi<=X[l-1]:
		l-=1
		mi=min(mi,X[l]-A[l])
		ma=max(ma,X[l]+A[l])
	else:
		mi=min(mi,X[r]-A[r])
		ma=max(ma,X[r]+A[r])
		r+=1
ans=r-l
print(ans)
0