結果

問題 No.944 煎っぞ!
ユーザー KodaiKodai
提出日時 2020-04-30 17:17:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 98 ms / 3,000 ms
コード長 615 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 87,164 KB
実行使用メモリ 89,888 KB
最終ジャッジ日時 2023-08-22 09:00:31
合計ジャッジ時間 6,713 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
89,660 KB
testcase_01 AC 92 ms
89,408 KB
testcase_02 AC 97 ms
89,612 KB
testcase_03 AC 93 ms
89,572 KB
testcase_04 AC 93 ms
89,544 KB
testcase_05 AC 93 ms
89,596 KB
testcase_06 AC 94 ms
89,460 KB
testcase_07 AC 91 ms
89,404 KB
testcase_08 AC 93 ms
89,592 KB
testcase_09 AC 92 ms
89,592 KB
testcase_10 AC 79 ms
76,892 KB
testcase_11 AC 82 ms
77,496 KB
testcase_12 AC 81 ms
76,832 KB
testcase_13 AC 72 ms
71,460 KB
testcase_14 AC 80 ms
77,796 KB
testcase_15 AC 79 ms
76,708 KB
testcase_16 AC 72 ms
71,560 KB
testcase_17 AC 74 ms
71,768 KB
testcase_18 AC 82 ms
77,628 KB
testcase_19 AC 82 ms
77,492 KB
testcase_20 AC 93 ms
89,760 KB
testcase_21 AC 94 ms
89,808 KB
testcase_22 AC 92 ms
89,608 KB
testcase_23 AC 91 ms
89,256 KB
testcase_24 AC 92 ms
89,764 KB
testcase_25 AC 94 ms
89,324 KB
testcase_26 AC 93 ms
89,256 KB
testcase_27 AC 98 ms
89,760 KB
testcase_28 AC 73 ms
71,720 KB
testcase_29 AC 73 ms
71,784 KB
testcase_30 AC 94 ms
89,888 KB
testcase_31 AC 93 ms
89,632 KB
testcase_32 AC 93 ms
89,676 KB
testcase_33 AC 94 ms
89,800 KB
testcase_34 AC 96 ms
89,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
a_list = list(map(int, input().split()))
a_sum = sum(a_list)
a_max = max(a_list)
div_list = []
for i in range(1, int(a_sum**0.5) + 1):
    if a_sum % i == 0:
        if i >= a_max:
            div_list.append(i)
        if i != a_sum // i:
            if (a_sum // i) >= a_max:
                div_list.append(a_sum // i)

div_list.sort()

for div in div_list:
    end = True
    count = 0
    for a in a_list:
        count += a
        if count > div:
            end = False
            break
        elif count == div:
            count = 0
    if end:
        print(a_sum // div)
        break
0