結果

問題 No.944 煎っぞ!
ユーザー 12354865271235486527
提出日時 2019-12-26 15:09:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 132 ms / 3,000 ms
コード長 456 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 17,372 KB
最終ジャッジ日時 2024-04-15 00:26:15
合計ジャッジ時間 4,331 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
13,276 KB
testcase_01 AC 89 ms
13,280 KB
testcase_02 AC 99 ms
13,272 KB
testcase_03 AC 98 ms
13,280 KB
testcase_04 AC 132 ms
13,292 KB
testcase_05 AC 76 ms
13,288 KB
testcase_06 AC 96 ms
13,292 KB
testcase_07 AC 99 ms
13,292 KB
testcase_08 AC 124 ms
13,152 KB
testcase_09 AC 81 ms
13,152 KB
testcase_10 AC 30 ms
10,752 KB
testcase_11 AC 43 ms
12,032 KB
testcase_12 AC 36 ms
11,392 KB
testcase_13 AC 29 ms
10,880 KB
testcase_14 AC 49 ms
12,032 KB
testcase_15 AC 34 ms
11,392 KB
testcase_16 AC 30 ms
10,752 KB
testcase_17 AC 30 ms
10,880 KB
testcase_18 AC 43 ms
11,904 KB
testcase_19 AC 42 ms
11,904 KB
testcase_20 AC 88 ms
17,260 KB
testcase_21 AC 93 ms
17,256 KB
testcase_22 AC 79 ms
12,640 KB
testcase_23 AC 84 ms
12,644 KB
testcase_24 AC 121 ms
12,768 KB
testcase_25 AC 83 ms
12,644 KB
testcase_26 AC 76 ms
12,644 KB
testcase_27 AC 81 ms
16,304 KB
testcase_28 AC 29 ms
10,752 KB
testcase_29 AC 30 ms
11,008 KB
testcase_30 AC 112 ms
17,372 KB
testcase_31 AC 73 ms
12,644 KB
testcase_32 AC 74 ms
12,644 KB
testcase_33 AC 78 ms
14,732 KB
testcase_34 AC 78 ms
14,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def divisor(N):
    ret = []
    c = int(N**0.5) + 1
    for i in range(1, c):
        if N % i == 0:
            ret.append(i)
            if N != i * i:
                ret.append(N//i)
    ret.sort()
    return ret

_ = int(input())
A = list(map(int, input().split()))
s = sum(A)
for d in divisor(s):
    n = 0
    for a in A:
        n += a
        if n > d:
            break
        elif n == d:
            n = 0
    else:
        break
print(s//d)
0