結果

問題 No.2500 Products in a Range
ユーザー mkawa2mkawa2
提出日時 2023-10-13 22:32:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,138 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 273,932 KB
最終ジャッジ日時 2023-10-13 22:32:50
合計ジャッジ時間 17,908 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
71,316 KB
testcase_01 AC 71 ms
71,412 KB
testcase_02 AC 92 ms
76,512 KB
testcase_03 AC 80 ms
76,004 KB
testcase_04 AC 88 ms
76,636 KB
testcase_05 AC 93 ms
76,604 KB
testcase_06 AC 85 ms
76,128 KB
testcase_07 AC 210 ms
106,072 KB
testcase_08 AC 514 ms
228,092 KB
testcase_09 AC 92 ms
76,356 KB
testcase_10 AC 472 ms
178,032 KB
testcase_11 AC 599 ms
204,932 KB
testcase_12 AC 248 ms
113,512 KB
testcase_13 AC 93 ms
76,248 KB
testcase_14 AC 608 ms
228,140 KB
testcase_15 AC 111 ms
83,716 KB
testcase_16 AC 317 ms
202,984 KB
testcase_17 AC 190 ms
132,808 KB
testcase_18 AC 201 ms
136,048 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 473 ms
273,448 KB
testcase_23 AC 460 ms
273,648 KB
testcase_24 AC 462 ms
273,708 KB
testcase_25 AC 901 ms
273,924 KB
testcase_26 AC 908 ms
273,932 KB
testcase_27 AC 914 ms
273,920 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 236 ms
113,540 KB
testcase_34 AC 515 ms
182,252 KB
testcase_35 AC 69 ms
71,188 KB
testcase_36 AC 70 ms
71,208 KB
testcase_37 AC 70 ms
71,204 KB
testcase_38 AC 68 ms
71,504 KB
testcase_39 AC 69 ms
71,244 KB
testcase_40 AC 69 ms
71,052 KB
testcase_41 AC 77 ms
71,260 KB
testcase_42 AC 72 ms
71,268 KB
testcase_43 AC 71 ms
71,052 KB
testcase_44 AC 150 ms
90,664 KB
testcase_45 AC 80 ms
76,336 KB
testcase_46 AC 162 ms
113,368 KB
testcase_47 AC 860 ms
273,804 KB
testcase_48 AC 78 ms
75,836 KB
testcase_49 WA -
testcase_50 AC 201 ms
136,200 KB
testcase_51 AC 219 ms
136,120 KB
testcase_52 AC 371 ms
227,976 KB
testcase_53 AC 118 ms
90,692 KB
testcase_54 AC 75 ms
76,044 KB
testcase_55 AC 199 ms
136,340 KB
testcase_56 AC 218 ms
136,132 KB
testcase_57 AC 429 ms
227,992 KB
testcase_58 AC 120 ms
90,668 KB
testcase_59 AC 411 ms
248,876 KB
testcase_60 AC 87 ms
76,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
# sys.set_int_max_str_digits(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()

dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
# inf = -1-(-1 << 31)
inf = -1-(-1 << 63)
# md = 10**9+7
md = 998244353

n, l, r = LI()
aa = LI()
aa.sort()

dp = [[0]*n for _ in range(n)]
for i in range(n):
    dp[i][i]=1
    for j in range(i):
        if l <= aa[i]*aa[j] <= r: dp[i][j] = dp[j][i] = 1

for i in range(n-1):
    for j in range(n-1):
        if dp[i+1][j+1]==0:continue
        dp[i+1][j+1]=min(dp[i][j],dp[i+1][j],dp[i][j+1])+1

ans=max(dp[i][i] for i in range(n))
print(ans)
0