結果

問題 No.944 煎っぞ!
ユーザー norioc
提出日時 2024-07-02 20:51:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 91 ms / 3,000 ms
コード長 351 bytes
コンパイル時間 202 ms
コンパイル使用メモリ 82,204 KB
実行使用メモリ 103,168 KB
最終ジャッジ日時 2024-07-02 20:51:55
合計ジャッジ時間 3,640 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate

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

acc = list(accumulate(A))
tot = sum(A)
st = set(acc)
for b in acc:  # 作られる数列の要素
    if tot % b != 0: continue

    for x in range(b+b, tot, b):
        if x not in st:
            break
    else:
        print(tot // b)
        exit()

print(1)
0