結果

問題 No.2221 Set X
ユーザー ShirotsumeShirotsume
提出日時 2023-02-14 22:17:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 706 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 94,432 KB
最終ジャッジ日時 2023-09-24 09:24:20
合計ジャッジ時間 20,099 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
73,376 KB
testcase_01 AC 116 ms
73,204 KB
testcase_02 AC 114 ms
73,736 KB
testcase_03 AC 115 ms
73,276 KB
testcase_04 AC 114 ms
73,396 KB
testcase_05 AC 113 ms
73,204 KB
testcase_06 AC 116 ms
73,528 KB
testcase_07 AC 114 ms
73,744 KB
testcase_08 AC 127 ms
78,132 KB
testcase_09 AC 117 ms
77,272 KB
testcase_10 AC 131 ms
78,464 KB
testcase_11 AC 126 ms
77,948 KB
testcase_12 AC 123 ms
78,244 KB
testcase_13 AC 125 ms
78,088 KB
testcase_14 AC 135 ms
79,616 KB
testcase_15 AC 128 ms
77,940 KB
testcase_16 AC 315 ms
82,936 KB
testcase_17 AC 207 ms
80,628 KB
testcase_18 AC 348 ms
84,020 KB
testcase_19 AC 201 ms
80,336 KB
testcase_20 AC 257 ms
81,088 KB
testcase_21 AC 344 ms
85,820 KB
testcase_22 AC 423 ms
89,540 KB
testcase_23 AC 153 ms
80,016 KB
testcase_24 AC 396 ms
85,564 KB
testcase_25 AC 255 ms
82,608 KB
testcase_26 AC 497 ms
93,252 KB
testcase_27 AC 530 ms
94,268 KB
testcase_28 AC 525 ms
94,128 KB
testcase_29 WA -
testcase_30 AC 475 ms
94,100 KB
testcase_31 AC 522 ms
93,972 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 485 ms
91,676 KB
testcase_40 AC 498 ms
92,396 KB
testcase_41 AC 500 ms
93,924 KB
testcase_42 AC 496 ms
93,756 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 False
        now = bisect.bisect_left(a, x * (a[now] // x + 1))
    return True

ans = 2 * n
x = 1

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

0