結果

問題 No.871 かえるのうた
ユーザー O2MTO2MT
提出日時 2020-08-24 12:56:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 493 bytes
コンパイル時間 231 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 29,116 KB
最終ジャッジ日時 2024-04-24 03:26:18
合計ジャッジ時間 5,066 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 28 ms
10,880 KB
testcase_03 AC 30 ms
10,880 KB
testcase_04 WA -
testcase_05 AC 25 ms
10,880 KB
testcase_06 AC 27 ms
10,752 KB
testcase_07 AC 29 ms
10,752 KB
testcase_08 AC 31 ms
11,136 KB
testcase_09 AC 31 ms
11,264 KB
testcase_10 WA -
testcase_11 AC 28 ms
10,880 KB
testcase_12 AC 40 ms
13,440 KB
testcase_13 AC 31 ms
11,520 KB
testcase_14 AC 98 ms
28,000 KB
testcase_15 AC 99 ms
26,800 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 102 ms
26,904 KB
testcase_20 WA -
testcase_21 AC 73 ms
16,256 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 30 ms
11,008 KB
testcase_26 AC 43 ms
12,032 KB
testcase_27 AC 36 ms
12,928 KB
testcase_28 AC 27 ms
10,880 KB
testcase_29 WA -
testcase_30 AC 156 ms
22,960 KB
testcase_31 WA -
testcase_32 AC 127 ms
21,268 KB
testcase_33 AC 92 ms
26,684 KB
testcase_34 WA -
testcase_35 AC 64 ms
19,428 KB
testcase_36 WA -
testcase_37 AC 102 ms
17,420 KB
testcase_38 AC 196 ms
27,008 KB
testcase_39 AC 178 ms
25,892 KB
testcase_40 WA -
testcase_41 AC 26 ms
10,752 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 28 ms
10,880 KB
testcase_47 AC 27 ms
10,880 KB
testcase_48 AC 27 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
X = list(map(int,input().split()))
A = list(map(int,input().split()))
kukan = [X[K-1]-A[K-1], X[K-1]+A[K-1]]
l = r = K
flg = True
while flg:
  flg = False
  while l >= 2 and kukan[0] <= X[l-1]:
    l-=1
    kukan[0] = min(kukan[0], X[l]-A[l])
    kukan[1] = max(kukan[1], X[l]+A[l])
    flg = True
  while r <= N-2 and X[r+1] <= kukan[1]:
    r+=1
    kukan[0] = min(kukan[0], X[r]-A[r])
    kukan[1] = max(kukan[1], X[r]+A[r])
    flg = True
print(r-l+1)
      
0