結果

問題 No.944 煎っぞ!
ユーザー zer0zer0
提出日時 2020-01-13 17:38:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 245 ms / 3,000 ms
コード長 515 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 10,964 KB
実行使用メモリ 38,024 KB
最終ジャッジ日時 2023-08-23 07:22:24
合計ジャッジ時間 12,016 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 228 ms
32,096 KB
testcase_01 AC 197 ms
32,052 KB
testcase_02 AC 207 ms
31,936 KB
testcase_03 AC 206 ms
32,076 KB
testcase_04 AC 245 ms
31,908 KB
testcase_05 AC 181 ms
32,092 KB
testcase_06 AC 200 ms
32,140 KB
testcase_07 AC 211 ms
32,220 KB
testcase_08 AC 238 ms
31,952 KB
testcase_09 AC 183 ms
32,092 KB
testcase_10 AC 129 ms
29,676 KB
testcase_11 AC 141 ms
31,176 KB
testcase_12 AC 134 ms
30,444 KB
testcase_13 AC 127 ms
29,604 KB
testcase_14 AC 146 ms
31,140 KB
testcase_15 AC 131 ms
30,336 KB
testcase_16 AC 129 ms
29,564 KB
testcase_17 AC 125 ms
29,504 KB
testcase_18 AC 140 ms
31,240 KB
testcase_19 AC 142 ms
31,264 KB
testcase_20 AC 192 ms
37,372 KB
testcase_21 AC 202 ms
37,388 KB
testcase_22 AC 183 ms
31,124 KB
testcase_23 AC 189 ms
31,060 KB
testcase_24 AC 231 ms
31,116 KB
testcase_25 AC 187 ms
31,236 KB
testcase_26 AC 182 ms
31,312 KB
testcase_27 AC 183 ms
36,796 KB
testcase_28 AC 125 ms
29,612 KB
testcase_29 AC 129 ms
29,624 KB
testcase_30 AC 221 ms
38,024 KB
testcase_31 AC 170 ms
31,268 KB
testcase_32 AC 169 ms
31,168 KB
testcase_33 AC 175 ms
33,948 KB
testcase_34 AC 178 ms
33,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

def div(n):
    rlst = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            rlst.append(i)
            if i != n // i:
                rlst.append(n // i)
    rlst.sort()
    return rlst

N = int(input())
a = list(map(int, input().split()))
totala = np.sum(a)
divlst = div(totala)

for i in divlst:
    tmp = 0
    for j in a:
        tmp += j
        if tmp > i:
            break
        elif tmp == i:
            tmp = 0
    else:
        break

print(totala // i)
0