結果

問題 No.2221 Set X
ユーザー flygonflygon
提出日時 2023-02-18 16:13:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 624 ms / 2,000 ms
コード長 547 bytes
コンパイル時間 258 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 92,132 KB
最終ジャッジ日時 2023-09-27 07:58:17
合計ジャッジ時間 16,304 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,816 KB
testcase_01 AC 91 ms
71,916 KB
testcase_02 AC 92 ms
71,592 KB
testcase_03 AC 91 ms
71,792 KB
testcase_04 AC 91 ms
71,888 KB
testcase_05 AC 91 ms
71,944 KB
testcase_06 AC 92 ms
71,364 KB
testcase_07 AC 91 ms
71,764 KB
testcase_08 AC 112 ms
77,348 KB
testcase_09 AC 99 ms
76,576 KB
testcase_10 AC 117 ms
77,068 KB
testcase_11 AC 109 ms
77,448 KB
testcase_12 AC 108 ms
77,192 KB
testcase_13 AC 107 ms
77,376 KB
testcase_14 AC 111 ms
77,392 KB
testcase_15 AC 106 ms
77,516 KB
testcase_16 AC 297 ms
81,124 KB
testcase_17 AC 183 ms
79,020 KB
testcase_18 AC 323 ms
82,004 KB
testcase_19 AC 176 ms
78,664 KB
testcase_20 AC 235 ms
79,772 KB
testcase_21 AC 321 ms
83,808 KB
testcase_22 AC 402 ms
86,832 KB
testcase_23 AC 130 ms
78,236 KB
testcase_24 AC 382 ms
83,424 KB
testcase_25 AC 230 ms
80,840 KB
testcase_26 AC 510 ms
91,088 KB
testcase_27 AC 586 ms
92,060 KB
testcase_28 AC 587 ms
92,080 KB
testcase_29 AC 617 ms
92,068 KB
testcase_30 AC 584 ms
92,020 KB
testcase_31 AC 619 ms
92,108 KB
testcase_32 AC 611 ms
91,952 KB
testcase_33 AC 561 ms
92,132 KB
testcase_34 AC 585 ms
92,100 KB
testcase_35 AC 598 ms
91,944 KB
testcase_36 AC 620 ms
92,084 KB
testcase_37 AC 624 ms
91,920 KB
testcase_38 AC 615 ms
91,940 KB
testcase_39 AC 527 ms
89,416 KB
testcase_40 AC 548 ms
90,508 KB
testcase_41 AC 603 ms
91,780 KB
testcase_42 AC 602 ms
91,880 KB
権限があれば一括ダウンロードができます

ソースコード

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

n = int(input())
a = list(map(int,input().split()))
a.append(10**10)

ans = [2*n, 1]
for i in range(2, 2*n+1):
  j = 0
  cnt = 0
  while j < n:
    now = a[j]//i
    t = bisect_left(a, i*(now+1))
    j = t
    cnt += 1
    if (i+1) * cnt >= 2*n:
      break
  ans = min(ans, [cnt * (i+1), i])

print(ans[1])
print(ans[0])

0