結果

問題 No.871 かえるのうた
ユーザー O2MTO2MT
提出日時 2020-08-24 12:20:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 453 bytes
コンパイル時間 202 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 33,548 KB
最終ジャッジ日時 2024-04-24 03:24:53
合計ジャッジ時間 7,111 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
16,128 KB
testcase_01 AC 31 ms
10,752 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 31 ms
10,752 KB
testcase_04 AC 30 ms
10,624 KB
testcase_05 AC 30 ms
10,624 KB
testcase_06 AC 31 ms
10,752 KB
testcase_07 AC 31 ms
10,624 KB
testcase_08 AC 41 ms
11,136 KB
testcase_09 AC 47 ms
11,136 KB
testcase_10 AC 35 ms
10,624 KB
testcase_11 AC 32 ms
10,752 KB
testcase_12 AC 282 ms
13,312 KB
testcase_13 AC 71 ms
11,392 KB
testcase_14 AC 148 ms
27,864 KB
testcase_15 AC 154 ms
28,008 KB
testcase_16 AC 370 ms
25,716 KB
testcase_17 AC 140 ms
26,488 KB
testcase_18 AC 50 ms
13,072 KB
testcase_19 TLE -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
X = list(map(int,input().split()))
A = list(map(int,input().split()))
check = [0]*N
kukan = [X[K-1]-A[K-1], X[K-1]+A[K-1]]
flg = True
while flg:
  count = 0
  for i in range(N):
    if kukan[0] <= X[i] <= kukan[1] and check[i] == 0:
      check[i] = 1
      count += 1
      kukan[0] = min(kukan[0], X[i]-A[i])
      kukan[1] = max(kukan[1], X[i]+A[i])
  if count == 0 or sum(check) == N:
    flg = False
print(sum(check))
0