結果

問題 No.944 煎っぞ!
コンテスト
ユーザー norioc
提出日時 2024-07-02 20:51:38
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 85 ms / 3,000 ms
コード長 351 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 174 ms
コンパイル使用メモリ 85,376 KB
実行使用メモリ 103,168 KB
最終ジャッジ日時 2026-03-24 04:33:12
合計ジャッジ時間 4,189 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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