結果

問題 No.944 煎っぞ!
ユーザー zer0zer0
提出日時 2020-01-13 18:33:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 423 ms / 3,000 ms
コード長 564 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 183,576 KB
最終ジャッジ日時 2023-08-23 09:24:46
合計ジャッジ時間 7,526 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 238 ms
127,900 KB
testcase_01 AC 148 ms
104,304 KB
testcase_02 AC 126 ms
96,348 KB
testcase_03 AC 139 ms
99,656 KB
testcase_04 AC 285 ms
140,596 KB
testcase_05 AC 107 ms
91,656 KB
testcase_06 AC 116 ms
93,432 KB
testcase_07 AC 138 ms
99,744 KB
testcase_08 AC 263 ms
134,196 KB
testcase_09 AC 114 ms
93,504 KB
testcase_10 AC 89 ms
76,896 KB
testcase_11 AC 115 ms
85,296 KB
testcase_12 AC 101 ms
76,856 KB
testcase_13 AC 80 ms
75,848 KB
testcase_14 AC 115 ms
85,524 KB
testcase_15 AC 101 ms
76,932 KB
testcase_16 AC 77 ms
71,848 KB
testcase_17 AC 80 ms
76,160 KB
testcase_18 AC 114 ms
85,776 KB
testcase_19 AC 116 ms
84,896 KB
testcase_20 AC 123 ms
96,868 KB
testcase_21 AC 128 ms
96,596 KB
testcase_22 AC 127 ms
96,556 KB
testcase_23 AC 165 ms
108,912 KB
testcase_24 AC 328 ms
152,768 KB
testcase_25 AC 133 ms
99,840 KB
testcase_26 AC 135 ms
99,652 KB
testcase_27 AC 423 ms
183,576 KB
testcase_28 AC 79 ms
71,768 KB
testcase_29 AC 77 ms
71,372 KB
testcase_30 AC 172 ms
109,284 KB
testcase_31 AC 204 ms
118,456 KB
testcase_32 AC 151 ms
102,652 KB
testcase_33 AC 229 ms
127,696 KB
testcase_34 AC 213 ms
121,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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 = sum(a)
divlst = div(totala)
ruia = [0] * (N + 1)
for i in range(N):
    ruia[i + 1] = a[i] + ruia[i]

ans = 0
for i in divlst:
    tmp = totala // i
    cnt = 0
    for j in ruia[1:]:
        if j % i == 0:
            cnt += 1

    if tmp == cnt:
        ans = max(ans, cnt)

print(ans)
0