結果

問題 No.2221 Set X
ユーザー ShirotsumeShirotsume
提出日時 2023-02-14 22:19:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 499 ms / 2,000 ms
コード長 650 bytes
コンパイル時間 1,177 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 94,156 KB
最終ジャッジ日時 2023-09-24 09:25:54
合計ジャッジ時間 15,923 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
73,568 KB
testcase_01 AC 103 ms
73,552 KB
testcase_02 AC 105 ms
73,572 KB
testcase_03 AC 104 ms
73,568 KB
testcase_04 AC 106 ms
73,444 KB
testcase_05 AC 104 ms
73,264 KB
testcase_06 AC 106 ms
73,328 KB
testcase_07 AC 110 ms
73,232 KB
testcase_08 AC 122 ms
78,340 KB
testcase_09 AC 109 ms
77,384 KB
testcase_10 AC 120 ms
78,096 KB
testcase_11 AC 114 ms
78,084 KB
testcase_12 AC 117 ms
77,948 KB
testcase_13 AC 110 ms
78,092 KB
testcase_14 AC 129 ms
79,416 KB
testcase_15 AC 121 ms
78,232 KB
testcase_16 AC 305 ms
82,804 KB
testcase_17 AC 204 ms
80,748 KB
testcase_18 AC 341 ms
83,840 KB
testcase_19 AC 191 ms
80,564 KB
testcase_20 AC 249 ms
81,184 KB
testcase_21 AC 319 ms
85,204 KB
testcase_22 AC 398 ms
89,244 KB
testcase_23 AC 149 ms
79,752 KB
testcase_24 AC 374 ms
85,160 KB
testcase_25 AC 235 ms
82,792 KB
testcase_26 AC 469 ms
92,836 KB
testcase_27 AC 499 ms
94,004 KB
testcase_28 AC 499 ms
93,972 KB
testcase_29 AC 411 ms
93,860 KB
testcase_30 AC 434 ms
93,868 KB
testcase_31 AC 487 ms
94,024 KB
testcase_32 AC 423 ms
93,784 KB
testcase_33 AC 472 ms
94,108 KB
testcase_34 AC 449 ms
93,856 KB
testcase_35 AC 415 ms
94,076 KB
testcase_36 AC 432 ms
94,156 KB
testcase_37 AC 456 ms
93,800 KB
testcase_38 AC 439 ms
93,780 KB
testcase_39 AC 452 ms
91,476 KB
testcase_40 AC 471 ms
92,044 KB
testcase_41 AC 466 ms
93,832 KB
testcase_42 AC 465 ms
93,984 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