結果

問題 No.944 煎っぞ!
ユーザー 👑 H20H20
提出日時 2021-01-18 09:44:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 61 ms / 3,000 ms
コード長 640 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 82,364 KB
実行使用メモリ 80,948 KB
最終ジャッジ日時 2024-05-07 23:44:29
合計ジャッジ時間 3,415 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
78,552 KB
testcase_01 AC 59 ms
78,712 KB
testcase_02 AC 58 ms
78,696 KB
testcase_03 AC 58 ms
79,196 KB
testcase_04 AC 61 ms
78,400 KB
testcase_05 AC 57 ms
78,344 KB
testcase_06 AC 59 ms
79,012 KB
testcase_07 AC 58 ms
79,452 KB
testcase_08 AC 58 ms
79,612 KB
testcase_09 AC 59 ms
78,600 KB
testcase_10 AC 42 ms
60,892 KB
testcase_11 AC 45 ms
64,220 KB
testcase_12 AC 43 ms
61,708 KB
testcase_13 AC 36 ms
53,108 KB
testcase_14 AC 43 ms
63,996 KB
testcase_15 AC 41 ms
62,304 KB
testcase_16 AC 35 ms
52,328 KB
testcase_17 AC 36 ms
52,892 KB
testcase_18 AC 42 ms
63,692 KB
testcase_19 AC 45 ms
63,948 KB
testcase_20 AC 57 ms
79,376 KB
testcase_21 AC 60 ms
80,948 KB
testcase_22 AC 57 ms
78,848 KB
testcase_23 AC 57 ms
78,620 KB
testcase_24 AC 59 ms
79,088 KB
testcase_25 AC 57 ms
78,300 KB
testcase_26 AC 55 ms
78,576 KB
testcase_27 AC 59 ms
78,984 KB
testcase_28 AC 36 ms
52,860 KB
testcase_29 AC 36 ms
53,932 KB
testcase_30 AC 59 ms
80,836 KB
testcase_31 AC 57 ms
79,592 KB
testcase_32 AC 57 ms
78,428 KB
testcase_33 AC 59 ms
78,976 KB
testcase_34 AC 59 ms
79,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

N = int(input())
A = list(map(int,input().split()))
SUMA = sum(A)
D = make_divisors(SUMA)
lower = max(A)
for d in D:
    if lower<=d:
        temp = 0
        for a in A:
            temp += a
            if temp>d:
                break
            if temp==d:
                temp = 0
        else:
            print(SUMA//d)
            exit()
0