結果

問題 No.2221 Set X
ユーザー aaaaaaaaaa2230
提出日時 2023-02-18 16:50:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 622 ms / 2,000 ms
コード長 482 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 95,104 KB
最終ジャッジ日時 2024-07-20 02:24:13
合計ジャッジ時間 13,088 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect

n = int(input())
A = list(map(int,input().split())) + [10**20]

ans = 2*n
ansx = 1
for x in range(1,2*n):
    count = 0
    now = 0
    while now < n:
        a = A[now]
        d = a//x
        na = x*(d+1)
        nex = bisect.bisect_left(A,na)
        count += 1
        now = nex
        # print(x,a,na,A[nex],now,count)
        if count * (x+1) >= ans:
            break
    if ans > count*(x+1):
        ans = count*(x+1)
        ansx = x
print(ansx)
print(ans)
0