結果

問題 No.871 かえるのうた
ユーザー O2MTO2MT
提出日時 2020-08-24 12:20:53
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 453 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 98,944 KB
最終ジャッジ日時 2024-04-24 03:25:06
合計ジャッジ時間 11,280 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
57,472 KB
testcase_01 AC 39 ms
52,352 KB
testcase_02 AC 40 ms
51,584 KB
testcase_03 AC 40 ms
52,352 KB
testcase_04 AC 39 ms
52,224 KB
testcase_05 AC 39 ms
52,352 KB
testcase_06 AC 39 ms
52,096 KB
testcase_07 AC 41 ms
52,096 KB
testcase_08 AC 55 ms
62,080 KB
testcase_09 AC 50 ms
62,208 KB
testcase_10 AC 53 ms
61,312 KB
testcase_11 AC 47 ms
59,904 KB
testcase_12 AC 69 ms
72,704 KB
testcase_13 AC 55 ms
64,000 KB
testcase_14 AC 102 ms
93,368 KB
testcase_15 AC 100 ms
93,784 KB
testcase_16 AC 116 ms
95,008 KB
testcase_17 AC 95 ms
94,892 KB
testcase_18 AC 55 ms
70,912 KB
testcase_19 AC 558 ms
94,924 KB
testcase_20 AC 49 ms
64,512 KB
testcase_21 AC 481 ms
85,632 KB
testcase_22 AC 39 ms
52,352 KB
testcase_23 AC 39 ms
51,968 KB
testcase_24 AC 41 ms
51,968 KB
testcase_25 AC 54 ms
63,232 KB
testcase_26 AC 61 ms
67,584 KB
testcase_27 AC 53 ms
67,840 KB
testcase_28 AC 39 ms
51,968 KB
testcase_29 AC 71 ms
89,856 KB
testcase_30 AC 549 ms
98,768 KB
testcase_31 AC 48 ms
61,440 KB
testcase_32 AC 1,075 ms
95,104 KB
testcase_33 AC 187 ms
96,384 KB
testcase_34 AC 58 ms
73,088 KB
testcase_35 AC 101 ms
92,800 KB
testcase_36 AC 94 ms
98,944 KB
testcase_37 AC 176 ms
87,680 KB
testcase_38 AC 265 ms
94,976 KB
testcase_39 AC 1,272 ms
93,312 KB
testcase_40 TLE -
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