結果

問題 No.2221 Set X
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2023-02-18 16:50:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 641 ms / 2,000 ms
コード長 482 bytes
コンパイル時間 1,355 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 95,856 KB
最終ジャッジ日時 2023-09-27 08:17:43
合計ジャッジ時間 14,475 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,372 KB
testcase_01 AC 61 ms
71,480 KB
testcase_02 AC 63 ms
71,216 KB
testcase_03 AC 67 ms
71,284 KB
testcase_04 AC 66 ms
71,600 KB
testcase_05 AC 64 ms
71,372 KB
testcase_06 AC 65 ms
71,356 KB
testcase_07 AC 63 ms
71,284 KB
testcase_08 AC 80 ms
76,476 KB
testcase_09 AC 71 ms
75,592 KB
testcase_10 AC 87 ms
76,600 KB
testcase_11 AC 74 ms
76,472 KB
testcase_12 AC 77 ms
76,408 KB
testcase_13 AC 79 ms
76,756 KB
testcase_14 AC 89 ms
76,868 KB
testcase_15 AC 82 ms
76,524 KB
testcase_16 AC 290 ms
82,124 KB
testcase_17 AC 164 ms
78,364 KB
testcase_18 AC 319 ms
82,948 KB
testcase_19 AC 154 ms
77,928 KB
testcase_20 AC 217 ms
79,620 KB
testcase_21 AC 297 ms
85,264 KB
testcase_22 AC 364 ms
89,236 KB
testcase_23 AC 107 ms
78,032 KB
testcase_24 AC 376 ms
84,948 KB
testcase_25 AC 204 ms
81,496 KB
testcase_26 AC 545 ms
94,552 KB
testcase_27 AC 630 ms
95,528 KB
testcase_28 AC 641 ms
95,644 KB
testcase_29 AC 450 ms
95,784 KB
testcase_30 AC 503 ms
95,812 KB
testcase_31 AC 600 ms
95,528 KB
testcase_32 AC 417 ms
95,600 KB
testcase_33 AC 446 ms
95,672 KB
testcase_34 AC 434 ms
95,556 KB
testcase_35 AC 404 ms
95,740 KB
testcase_36 AC 478 ms
95,856 KB
testcase_37 AC 492 ms
95,716 KB
testcase_38 AC 488 ms
95,620 KB
testcase_39 AC 534 ms
92,708 KB
testcase_40 AC 571 ms
94,012 KB
testcase_41 AC 536 ms
95,600 KB
testcase_42 AC 522 ms
95,708 KB
権限があれば一括ダウンロードができます

ソースコード

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