結果

問題 No.944 煎っぞ!
ユーザー 👑 jupirojupiro
提出日時 2020-02-10 14:39:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 245 ms / 3,000 ms
コード長 538 bytes
コンパイル時間 109 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 18,484 KB
最終ジャッジ日時 2024-04-08 13:00:23
合計ジャッジ時間 5,547 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 210 ms
15,596 KB
testcase_01 AC 159 ms
15,600 KB
testcase_02 AC 167 ms
15,596 KB
testcase_03 AC 171 ms
15,600 KB
testcase_04 AC 245 ms
15,616 KB
testcase_05 AC 120 ms
15,608 KB
testcase_06 AC 158 ms
15,612 KB
testcase_07 AC 167 ms
15,616 KB
testcase_08 AC 222 ms
15,604 KB
testcase_09 AC 126 ms
15,600 KB
testcase_10 AC 35 ms
10,112 KB
testcase_11 AC 57 ms
11,520 KB
testcase_12 AC 43 ms
10,880 KB
testcase_13 AC 32 ms
10,112 KB
testcase_14 AC 69 ms
11,520 KB
testcase_15 AC 45 ms
10,752 KB
testcase_16 AC 33 ms
10,112 KB
testcase_17 AC 34 ms
10,112 KB
testcase_18 AC 56 ms
11,520 KB
testcase_19 AC 55 ms
11,520 KB
testcase_20 AC 142 ms
17,964 KB
testcase_21 AC 149 ms
17,964 KB
testcase_22 AC 125 ms
15,468 KB
testcase_23 AC 138 ms
15,468 KB
testcase_24 AC 221 ms
15,468 KB
testcase_25 AC 138 ms
15,468 KB
testcase_26 AC 128 ms
15,468 KB
testcase_27 AC 142 ms
16,940 KB
testcase_28 AC 35 ms
10,112 KB
testcase_29 AC 33 ms
10,112 KB
testcase_30 AC 186 ms
18,484 KB
testcase_31 AC 85 ms
11,848 KB
testcase_32 AC 99 ms
12,268 KB
testcase_33 AC 112 ms
14,716 KB
testcase_34 AC 116 ms
14,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
a = list(map(int,input().split()))

sm = 0
d = []
for e in a:
    sm += e

for i in range(1, sm + 1):
    if(i * i > sm):
        break
    if sm % i == 0:
        d.append(i)
        if i != sm // i:
            d.append(sm//i)

d.sort(reverse = True)

for e in d:
    flag = True
    g = sm//e
    b = a.copy()
    for i in range(len(b)):
        if b[i] > g:
            flag = False
            break
        if b[i] < g and i != len(b) - 1:
            b[i + 1] += b[i]
    if flag :
        print(e)
        exit()
0