結果
問題 | No.2500 Products in a Range |
ユーザー | flygon |
提出日時 | 2023-10-13 21:55:30 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 957 bytes |
コンパイル時間 | 316 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 77,824 KB |
最終ジャッジ日時 | 2024-09-15 17:36:20 |
合計ジャッジ時間 | 14,234 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge6 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 44 ms
54,144 KB |
testcase_01 | AC | 47 ms
54,400 KB |
testcase_02 | AC | 95 ms
76,544 KB |
testcase_03 | AC | 79 ms
72,832 KB |
testcase_04 | AC | 106 ms
76,416 KB |
testcase_05 | AC | 83 ms
74,112 KB |
testcase_06 | AC | 67 ms
68,096 KB |
testcase_07 | AC | 221 ms
76,928 KB |
testcase_08 | AC | 1,367 ms
77,256 KB |
testcase_09 | AC | 103 ms
76,416 KB |
testcase_10 | AC | 196 ms
76,288 KB |
testcase_11 | AC | 232 ms
76,160 KB |
testcase_12 | AC | 132 ms
76,416 KB |
testcase_13 | AC | 127 ms
76,928 KB |
testcase_14 | AC | 1,492 ms
77,324 KB |
testcase_15 | AC | 148 ms
76,800 KB |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | AC | 312 ms
76,416 KB |
testcase_20 | AC | 335 ms
76,160 KB |
testcase_21 | AC | 84 ms
74,112 KB |
testcase_22 | AC | 520 ms
76,800 KB |
testcase_23 | AC | 375 ms
76,928 KB |
testcase_24 | AC | 487 ms
76,928 KB |
testcase_25 | AC | 313 ms
76,416 KB |
testcase_26 | AC | 316 ms
75,904 KB |
testcase_27 | AC | 309 ms
75,904 KB |
testcase_28 | AC | 287 ms
76,160 KB |
testcase_29 | AC | 95 ms
76,800 KB |
testcase_30 | AC | 93 ms
76,544 KB |
testcase_31 | AC | 75 ms
71,552 KB |
testcase_32 | AC | 75 ms
71,808 KB |
testcase_33 | AC | 120 ms
76,160 KB |
testcase_34 | AC | 205 ms
76,032 KB |
testcase_35 | AC | 45 ms
54,400 KB |
testcase_36 | AC | 45 ms
54,144 KB |
testcase_37 | AC | 45 ms
54,144 KB |
testcase_38 | AC | 45 ms
54,272 KB |
testcase_39 | AC | 45 ms
54,784 KB |
testcase_40 | WA | - |
testcase_41 | WA | - |
testcase_42 | AC | 44 ms
54,528 KB |
testcase_43 | WA | - |
testcase_44 | AC | 86 ms
75,904 KB |
testcase_45 | WA | - |
testcase_46 | WA | - |
testcase_47 | AC | 310 ms
76,032 KB |
testcase_48 | WA | - |
testcase_49 | AC | 66 ms
67,200 KB |
testcase_50 | AC | 170 ms
76,672 KB |
testcase_51 | AC | 237 ms
77,808 KB |
testcase_52 | AC | 355 ms
76,672 KB |
testcase_53 | AC | 148 ms
77,568 KB |
testcase_54 | AC | 58 ms
64,640 KB |
testcase_55 | AC | 172 ms
77,056 KB |
testcase_56 | AC | 199 ms
77,824 KB |
testcase_57 | AC | 483 ms
76,852 KB |
testcase_58 | WA | - |
testcase_59 | WA | - |
testcase_60 | WA | - |
ソースコード
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)