結果

問題 No.2500 Products in a Range
ユーザー shotoyooshotoyoo
提出日時 2023-10-13 22:47:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 382 ms / 2,000 ms
コード長 1,002 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 87,164 KB
実行使用メモリ 78,284 KB
最終ジャッジ日時 2023-10-13 22:47:54
合計ジャッジ時間 12,643 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
71,924 KB
testcase_01 AC 87 ms
71,908 KB
testcase_02 AC 117 ms
77,728 KB
testcase_03 AC 102 ms
77,092 KB
testcase_04 AC 107 ms
77,808 KB
testcase_05 AC 118 ms
77,812 KB
testcase_06 AC 102 ms
76,632 KB
testcase_07 AC 139 ms
77,976 KB
testcase_08 AC 309 ms
78,036 KB
testcase_09 AC 108 ms
78,008 KB
testcase_10 AC 252 ms
77,912 KB
testcase_11 AC 221 ms
78,156 KB
testcase_12 AC 173 ms
77,964 KB
testcase_13 AC 112 ms
77,552 KB
testcase_14 AC 321 ms
78,040 KB
testcase_15 AC 118 ms
77,700 KB
testcase_16 AC 179 ms
78,020 KB
testcase_17 AC 136 ms
77,880 KB
testcase_18 AC 142 ms
77,960 KB
testcase_19 AC 204 ms
77,852 KB
testcase_20 AC 222 ms
77,848 KB
testcase_21 AC 110 ms
78,088 KB
testcase_22 AC 253 ms
77,988 KB
testcase_23 AC 254 ms
77,820 KB
testcase_24 AC 270 ms
77,936 KB
testcase_25 AC 380 ms
78,128 KB
testcase_26 AC 382 ms
78,052 KB
testcase_27 AC 273 ms
78,084 KB
testcase_28 AC 197 ms
78,012 KB
testcase_29 AC 122 ms
77,952 KB
testcase_30 AC 119 ms
77,852 KB
testcase_31 AC 107 ms
77,476 KB
testcase_32 AC 114 ms
77,760 KB
testcase_33 AC 141 ms
77,496 KB
testcase_34 AC 203 ms
78,248 KB
testcase_35 AC 89 ms
71,788 KB
testcase_36 AC 88 ms
72,180 KB
testcase_37 AC 93 ms
72,068 KB
testcase_38 AC 89 ms
71,684 KB
testcase_39 AC 91 ms
72,176 KB
testcase_40 AC 90 ms
72,060 KB
testcase_41 AC 89 ms
72,200 KB
testcase_42 AC 91 ms
72,044 KB
testcase_43 AC 88 ms
72,236 KB
testcase_44 AC 124 ms
77,980 KB
testcase_45 AC 99 ms
77,596 KB
testcase_46 AC 127 ms
77,596 KB
testcase_47 AC 284 ms
78,284 KB
testcase_48 AC 95 ms
76,372 KB
testcase_49 AC 98 ms
77,020 KB
testcase_50 AC 158 ms
77,812 KB
testcase_51 AC 175 ms
78,104 KB
testcase_52 AC 216 ms
78,028 KB
testcase_53 AC 132 ms
77,720 KB
testcase_54 AC 93 ms
76,212 KB
testcase_55 AC 145 ms
77,868 KB
testcase_56 AC 156 ms
77,880 KB
testcase_57 AC 301 ms
77,916 KB
testcase_58 AC 116 ms
77,848 KB
testcase_59 AC 210 ms
77,584 KB
testcase_60 AC 106 ms
77,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, random
input = lambda : sys.stdin.readline().rstrip()


write = lambda x: sys.stdout.write(x+"\n"); writef = lambda x: print("{:.12f}".format(x))
debug = lambda x: sys.stderr.write(x+"\n")
YES="Yes"; NO="No"; pans = lambda v: print(YES if v else NO); INF=10**18
LI = lambda : list(map(int, input().split())); II=lambda : int(input()); SI=lambda : [ord(c)-ord("a") for c in input()]
def debug(_l_):
    for s in _l_.split():
        print(f"{s}={eval(s)}", end=" ")
    print()
def dlist(*l, fill=0):
    if len(l)==1:
        return [fill]*l[0]
    ll = l[1:]
    return [dlist(*ll, fill=fill) for _ in range(l[0])]

n,l,r = list(map(int, input().split()))
a = LI()
a.sort()
ans = 1
for i in range(n):
    for j in range(i+1, n+1):
        if j-i<=1:
            continue
        if l<=a[i]*a[i+1]<=r and l<=a[j-2]*a[j-1]<=r and l<=a[i]*a[j-1]<=r:
            ans = max(ans, j-i)
for i in range(n):
    for j in range(i):
        if l<=a[i]*a[j]<=r:
            ans = max(ans, 2)
print(ans)
0