結果

問題 No.2500 Products in a Range
ユーザー flygonflygon
提出日時 2023-10-13 21:54:52
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 957 bytes
コンパイル時間 1,387 ms
コンパイル使用メモリ 86,976 KB
実行使用メモリ 79,532 KB
最終ジャッジ日時 2023-10-13 21:55:15
合計ジャッジ時間 21,308 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
71,748 KB
testcase_01 AC 96 ms
71,588 KB
testcase_02 AC 146 ms
78,212 KB
testcase_03 AC 133 ms
78,084 KB
testcase_04 AC 157 ms
78,276 KB
testcase_05 AC 137 ms
78,224 KB
testcase_06 AC 135 ms
77,408 KB
testcase_07 AC 345 ms
78,052 KB
testcase_08 TLE -
testcase_09 AC 152 ms
78,304 KB
testcase_10 AC 243 ms
77,592 KB
testcase_11 AC 279 ms
77,812 KB
testcase_12 AC 179 ms
77,640 KB
testcase_13 AC 187 ms
78,412 KB
testcase_14 TLE -
testcase_15 AC 232 ms
78,416 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 355 ms
77,944 KB
testcase_20 AC 399 ms
78,048 KB
testcase_21 AC 137 ms
77,524 KB
testcase_22 AC 636 ms
79,136 KB
testcase_23 AC 463 ms
78,672 KB
testcase_24 AC 578 ms
78,876 KB
testcase_25 AC 403 ms
78,096 KB
testcase_26 AC 371 ms
78,152 KB
testcase_27 AC 361 ms
77,912 KB
testcase_28 AC 368 ms
78,028 KB
testcase_29 AC 143 ms
77,880 KB
testcase_30 AC 141 ms
77,864 KB
testcase_31 AC 130 ms
77,164 KB
testcase_32 AC 130 ms
77,724 KB
testcase_33 AC 169 ms
78,200 KB
testcase_34 AC 254 ms
77,764 KB
testcase_35 AC 104 ms
71,712 KB
testcase_36 AC 100 ms
71,320 KB
testcase_37 AC 100 ms
71,340 KB
testcase_38 AC 97 ms
71,684 KB
testcase_39 AC 99 ms
71,776 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 94 ms
71,548 KB
testcase_43 WA -
testcase_44 AC 148 ms
77,732 KB
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 355 ms
78,048 KB
testcase_48 WA -
testcase_49 AC 135 ms
77,588 KB
testcase_50 AC 235 ms
78,568 KB
testcase_51 AC 302 ms
79,220 KB
testcase_52 AC 413 ms
78,244 KB
testcase_53 AC 213 ms
79,532 KB
testcase_54 AC 123 ms
77,064 KB
testcase_55 AC 267 ms
78,424 KB
testcase_56 AC 267 ms
78,936 KB
testcase_57 AC 562 ms
78,392 KB
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd

def ju(m):
    ret = 0
    for s in range(n):
        goal = s+m-1
        if goal >= n:break
        ok = 1
        for i in range(s, goal+1):
            if i == s:
                ok &= l <= a[s] * a[i+1] <= r
                ok &= l <= a[s] * a[goal] <= r
            elif i == goal:
                ok &= l <= a[s] * a[i] <= r
                ok &= l <= a[i-1] * a[i] <= r
            else:
                ok &= l <= a[s] * a[i] <= r
                ok &= l <= a[i] * a[goal] <= r
        ret |= ok
    return ret
    

n,l,r = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
le = 2
ri = n+1
for _ in range(20):
    m = (le+ri)//2
    if ju(m):
        le = m
    else:
        ri = m

print(le)
        

0