結果

問題 No.2500 Products in a Range
ユーザー flygonflygon
提出日時 2023-10-13 21:55:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 957 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 87,188 KB
実行使用メモリ 79,636 KB
最終ジャッジ日時 2023-10-13 21:55:49
合計ジャッジ時間 18,021 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,352 KB
testcase_01 AC 91 ms
71,704 KB
testcase_02 AC 138 ms
77,768 KB
testcase_03 AC 124 ms
77,448 KB
testcase_04 AC 149 ms
78,516 KB
testcase_05 AC 127 ms
78,228 KB
testcase_06 AC 120 ms
77,264 KB
testcase_07 AC 265 ms
78,216 KB
testcase_08 AC 1,436 ms
79,024 KB
testcase_09 AC 145 ms
78,296 KB
testcase_10 AC 237 ms
77,872 KB
testcase_11 AC 297 ms
77,944 KB
testcase_12 AC 176 ms
77,964 KB
testcase_13 AC 172 ms
78,488 KB
testcase_14 AC 1,555 ms
78,516 KB
testcase_15 AC 193 ms
78,476 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 355 ms
77,932 KB
testcase_20 AC 404 ms
78,224 KB
testcase_21 AC 131 ms
77,904 KB
testcase_22 AC 558 ms
79,132 KB
testcase_23 AC 443 ms
78,756 KB
testcase_24 AC 528 ms
78,960 KB
testcase_25 AC 357 ms
78,208 KB
testcase_26 AC 385 ms
78,100 KB
testcase_27 AC 355 ms
78,124 KB
testcase_28 AC 330 ms
78,112 KB
testcase_29 AC 140 ms
77,852 KB
testcase_30 AC 140 ms
77,544 KB
testcase_31 AC 123 ms
77,156 KB
testcase_32 AC 123 ms
77,168 KB
testcase_33 AC 161 ms
78,172 KB
testcase_34 AC 247 ms
77,660 KB
testcase_35 AC 92 ms
71,376 KB
testcase_36 AC 94 ms
71,628 KB
testcase_37 AC 95 ms
71,816 KB
testcase_38 AC 96 ms
71,636 KB
testcase_39 AC 93 ms
71,820 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 93 ms
71,568 KB
testcase_43 WA -
testcase_44 AC 131 ms
77,980 KB
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 352 ms
77,700 KB
testcase_48 WA -
testcase_49 AC 113 ms
77,444 KB
testcase_50 AC 212 ms
78,752 KB
testcase_51 AC 278 ms
79,352 KB
testcase_52 AC 394 ms
78,104 KB
testcase_53 AC 191 ms
79,636 KB
testcase_54 AC 108 ms
77,464 KB
testcase_55 AC 210 ms
78,580 KB
testcase_56 AC 238 ms
78,084 KB
testcase_57 AC 520 ms
78,220 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(13):
    m = (le+ri)//2
    if ju(m):
        le = m
    else:
        ri = m

print(le)
        

0