結果

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

テストケース

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

ソースコード

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+1):
  if l <= A[li] * A[li+1] <= r:
    break
  else:
    li += 1

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

asc = 0
desc = 0
for n in range(ri-li+1):
  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