結果

問題 No.2221 Set X
ユーザー ShirotsumeShirotsume
提出日時 2023-02-14 22:22:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,063 ms / 2,000 ms
コード長 650 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 10,996 KB
実行使用メモリ 20,304 KB
最終ジャッジ日時 2023-09-24 09:28:44
合計ジャッジ時間 21,861 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
8,844 KB
testcase_01 AC 21 ms
9,072 KB
testcase_02 AC 21 ms
8,980 KB
testcase_03 AC 21 ms
9,028 KB
testcase_04 AC 20 ms
8,980 KB
testcase_05 AC 20 ms
8,976 KB
testcase_06 AC 20 ms
9,028 KB
testcase_07 AC 20 ms
8,856 KB
testcase_08 AC 22 ms
8,888 KB
testcase_09 AC 21 ms
9,040 KB
testcase_10 AC 23 ms
8,904 KB
testcase_11 AC 21 ms
9,068 KB
testcase_12 AC 21 ms
8,844 KB
testcase_13 AC 21 ms
9,060 KB
testcase_14 AC 23 ms
9,068 KB
testcase_15 AC 21 ms
8,868 KB
testcase_16 AC 385 ms
12,724 KB
testcase_17 AC 141 ms
10,376 KB
testcase_18 AC 447 ms
13,496 KB
testcase_19 AC 129 ms
10,392 KB
testcase_20 AC 259 ms
11,680 KB
testcase_21 AC 641 ms
14,204 KB
testcase_22 AC 866 ms
15,980 KB
testcase_23 AC 59 ms
9,544 KB
testcase_24 AC 582 ms
13,936 KB
testcase_25 AC 366 ms
12,072 KB
testcase_26 AC 878 ms
20,220 KB
testcase_27 AC 938 ms
19,576 KB
testcase_28 AC 950 ms
19,708 KB
testcase_29 AC 836 ms
19,776 KB
testcase_30 AC 838 ms
20,264 KB
testcase_31 AC 892 ms
19,812 KB
testcase_32 AC 853 ms
19,580 KB
testcase_33 AC 1,063 ms
19,660 KB
testcase_34 AC 967 ms
19,604 KB
testcase_35 AC 908 ms
19,592 KB
testcase_36 AC 861 ms
19,752 KB
testcase_37 AC 873 ms
19,572 KB
testcase_38 AC 854 ms
19,748 KB
testcase_39 AC 844 ms
20,128 KB
testcase_40 AC 895 ms
18,620 KB
testcase_41 AC 888 ms
20,304 KB
testcase_42 AC 877 ms
20,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import deque, Counter
import time
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353
import random
import bisect
n = ii()

a = li()

def check(x, k):
    now = 0
    cnt = 0
    while now < n:
        cnt += 1
        if cnt > k:
            return cnt
        now = bisect.bisect_left(a, x * (a[now] // x + 1))
    return cnt

ans = 2 * n
x = 1

for i in range(2, 2 * n):
    k = ans // (i + 1)
    p = check(i, k)
    if ans > p * (i + 1):
        ans = p * (i + 1)
        x = i

print(x)
print(ans)

0