結果

問題 No.2500 Products in a Range
ユーザー hato336
提出日時 2023-10-13 21:31:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 639 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 90,240 KB
最終ジャッジ日時 2024-09-15 17:08:03
合計ジャッジ時間 11,250 ms
ジャッジサーバーID
(参考情報)
judge3 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 48 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
#n = int(input())
#
#alist = []
#s = input()
n,l,r = map(int,input().split())
#for i in range(n):
#    alist.append(list(map(int,input().split())))
alist = list(map(int,input().split()))
alist.sort()
ans = 1
temp = 1
mi = -1
for i in range(n-1):
    if l <= alist[i] * alist[i+1] <= r and (mi == -1 or l <= mi * alist[i+1] <= r):
        temp += 1
        if temp == 2:
            mi = alist[i]
    else:
        ans = max(ans,temp)
        temp = 1
        mi = -1
ans = max(ans,temp)
#print(alist)
print(ans)
0