結果
問題 | No.2500 Products in a Range |
ユーザー | flygon |
提出日時 | 2023-10-13 22:12:11 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,111 bytes |
コンパイル時間 | 1,293 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 77,696 KB |
最終ジャッジ日時 | 2024-09-15 17:54:25 |
合計ジャッジ時間 | 16,336 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge6 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 47 ms
54,912 KB |
testcase_01 | AC | 49 ms
54,400 KB |
testcase_02 | AC | 96 ms
76,288 KB |
testcase_03 | AC | 94 ms
74,112 KB |
testcase_04 | AC | 120 ms
76,416 KB |
testcase_05 | AC | 98 ms
75,008 KB |
testcase_06 | AC | 77 ms
67,968 KB |
testcase_07 | AC | 254 ms
76,544 KB |
testcase_08 | AC | 1,553 ms
76,800 KB |
testcase_09 | AC | 116 ms
76,928 KB |
testcase_10 | AC | 207 ms
76,416 KB |
testcase_11 | AC | 245 ms
76,032 KB |
testcase_12 | AC | 142 ms
76,288 KB |
testcase_13 | AC | 143 ms
77,184 KB |
testcase_14 | AC | 1,706 ms
76,672 KB |
testcase_15 | AC | 164 ms
77,056 KB |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | AC | 393 ms
76,928 KB |
testcase_20 | AC | 421 ms
76,800 KB |
testcase_21 | AC | 113 ms
76,416 KB |
testcase_22 | AC | 549 ms
77,568 KB |
testcase_23 | AC | 388 ms
77,056 KB |
testcase_24 | AC | 504 ms
77,440 KB |
testcase_25 | AC | 323 ms
76,544 KB |
testcase_26 | AC | 328 ms
76,160 KB |
testcase_27 | AC | 321 ms
76,416 KB |
testcase_28 | AC | 359 ms
76,416 KB |
testcase_29 | AC | 127 ms
77,056 KB |
testcase_30 | AC | 121 ms
76,800 KB |
testcase_31 | AC | 101 ms
76,672 KB |
testcase_32 | AC | 102 ms
77,056 KB |
testcase_33 | AC | 130 ms
76,160 KB |
testcase_34 | AC | 215 ms
76,032 KB |
testcase_35 | AC | 49 ms
54,272 KB |
testcase_36 | AC | 48 ms
54,144 KB |
testcase_37 | AC | 48 ms
54,272 KB |
testcase_38 | AC | 49 ms
54,272 KB |
testcase_39 | AC | 49 ms
54,784 KB |
testcase_40 | WA | - |
testcase_41 | WA | - |
testcase_42 | AC | 47 ms
54,784 KB |
testcase_43 | WA | - |
testcase_44 | AC | 100 ms
75,904 KB |
testcase_45 | WA | - |
testcase_46 | WA | - |
testcase_47 | AC | 316 ms
76,288 KB |
testcase_48 | WA | - |
testcase_49 | AC | 81 ms
69,632 KB |
testcase_50 | AC | 182 ms
76,928 KB |
testcase_51 | AC | 251 ms
77,568 KB |
testcase_52 | AC | 365 ms
76,672 KB |
testcase_53 | AC | 166 ms
77,696 KB |
testcase_54 | AC | 67 ms
65,280 KB |
testcase_55 | AC | 190 ms
77,056 KB |
testcase_56 | AC | 214 ms
77,568 KB |
testcase_57 | AC | 499 ms
76,928 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[i] * a[i+1] <= r ok &= l <= a[i] * 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(15): m = (le+ri)//2 if ju(m): le = m else: ri = m if le != 2: print(le) else: ok = 0 for i in range(n): for j in range(i+1, n): ok |= l <= a[i]*a[j] <= r print(2) if ok else print('No')