結果
問題 | No.2221 Set X |
ユーザー |
|
提出日時 | 2023-02-14 22:19:35 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 478 ms / 2,000 ms |
コード長 | 650 bytes |
コンパイル時間 | 272 ms |
コンパイル使用メモリ | 82,316 KB |
実行使用メモリ | 91,924 KB |
最終ジャッジ日時 | 2024-07-17 10:10:40 |
合計ジャッジ時間 | 12,606 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 40 |
ソースコード
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)