結果

問題 No.2500 Products in a Range
ユーザー 無貌無貌
提出日時 2023-11-01 10:12:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 569 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 11,880 KB
実行使用メモリ 10,796 KB
最終ジャッジ日時 2023-11-01 10:12:12
合計ジャッジ時間 4,434 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,048 KB
testcase_01 AC 30 ms
10,048 KB
testcase_02 AC 30 ms
10,152 KB
testcase_03 AC 31 ms
10,120 KB
testcase_04 AC 31 ms
10,072 KB
testcase_05 AC 29 ms
10,136 KB
testcase_06 AC 33 ms
10,052 KB
testcase_07 AC 33 ms
10,220 KB
testcase_08 WA -
testcase_09 AC 37 ms
10,060 KB
testcase_10 AC 32 ms
10,520 KB
testcase_11 AC 32 ms
10,580 KB
testcase_12 AC 32 ms
10,384 KB
testcase_13 AC 31 ms
10,096 KB
testcase_14 AC 33 ms
10,604 KB
testcase_15 AC 30 ms
10,212 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 36 ms
10,664 KB
testcase_23 AC 36 ms
10,664 KB
testcase_24 AC 37 ms
10,664 KB
testcase_25 AC 33 ms
10,720 KB
testcase_26 AC 33 ms
10,720 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 32 ms
10,388 KB
testcase_34 AC 35 ms
10,576 KB
testcase_35 AC 30 ms
10,048 KB
testcase_36 AC 33 ms
10,048 KB
testcase_37 AC 30 ms
10,048 KB
testcase_38 AC 30 ms
10,048 KB
testcase_39 AC 31 ms
10,048 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 30 ms
10,048 KB
testcase_43 WA -
testcase_44 AC 30 ms
10,072 KB
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 33 ms
10,720 KB
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 AC 31 ms
10,112 KB
testcase_55 AC 32 ms
10,424 KB
testcase_56 AC 32 ms
10,452 KB
testcase_57 AC 33 ms
10,596 KB
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys; input = sys.stdin.readline
n, l, r = map(int, input().split())
A = tuple(sorted((map(int, input().split()))))
leng = len(A)

li = 0
ri = leng -1

for _ in range(ri-li):
  if l <= A[li] * A[li+1] <= r:
    break
  else:
    li += 1

for _ in range(ri-li):
  if l <= A[ri] * A[ri-1] <= r:
    break
  else:
    ri -= 1

asc = 0
desc = 0
for n in range(ri-li):
  if asc and desc:
    break
  if (not asc) and(l <= A[li+n] * A[ri] <= r):
    asc = ri - (li+n) + 1
  if (not desc) and(l <= A[li] * A[ri-n] <= r):
    desc = (ri-n) - li + 1

print(max(asc, desc))
0