結果

問題 No.2221 Set X
ユーザー stoqstoq
提出日時 2022-05-27 15:48:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 636 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 10,952 KB
実行使用メモリ 19,836 KB
最終ジャッジ日時 2023-09-14 23:56:52
合計ジャッジ時間 12,086 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
12,256 KB
testcase_01 AC 14 ms
7,784 KB
testcase_02 AC 15 ms
7,788 KB
testcase_03 AC 16 ms
7,784 KB
testcase_04 AC 15 ms
7,844 KB
testcase_05 AC 15 ms
7,752 KB
testcase_06 AC 16 ms
7,828 KB
testcase_07 AC 15 ms
7,856 KB
testcase_08 AC 21 ms
7,872 KB
testcase_09 AC 15 ms
7,752 KB
testcase_10 AC 23 ms
7,916 KB
testcase_11 AC 17 ms
7,928 KB
testcase_12 AC 18 ms
7,984 KB
testcase_13 AC 19 ms
7,924 KB
testcase_14 AC 27 ms
7,836 KB
testcase_15 AC 22 ms
7,924 KB
testcase_16 AC 1,387 ms
11,808 KB
testcase_17 AC 486 ms
9,592 KB
testcase_18 AC 1,656 ms
12,332 KB
testcase_19 AC 414 ms
9,388 KB
testcase_20 AC 922 ms
10,660 KB
testcase_21 TLE -
testcase_22 TLE -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin

input = stdin.readline

n = int(input())
a = list(map(int, input().split()))
a.append(int(2e9))

Min = int(1e18)
Minx = -1


def lower_bound(lo, val):
    hi = n + 1
    while hi - lo > 1:
        mi = (lo + hi) // 2
        if a[mi] >= val:
            hi = mi
        else:
            lo = mi
    return hi


for x in range(1, n * 2 + 1):
    i = 0
    k = 0
    while i < n:
        i = lower_bound(i, (a[i] // x + 1) * x)
        k += 1
        if (x + 1) * k >= Min:
            k = -1
            break
    if k != -1 and (x + 1) * k < Min:
        Min = (x + 1) * k
        Minx = x
print(Minx)
print(Min)
0