結果

問題 No.944 煎っぞ!
ユーザー 👑 rin204rin204
提出日時 2022-01-18 23:38:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 3,000 ms
コード長 500 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 94,336 KB
最終ジャッジ日時 2024-05-02 19:37:37
合計ジャッジ時間 4,247 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
93,056 KB
testcase_01 AC 73 ms
93,312 KB
testcase_02 AC 71 ms
93,056 KB
testcase_03 AC 76 ms
92,800 KB
testcase_04 AC 77 ms
92,928 KB
testcase_05 AC 77 ms
92,928 KB
testcase_06 AC 73 ms
93,056 KB
testcase_07 AC 72 ms
93,056 KB
testcase_08 AC 75 ms
93,056 KB
testcase_09 AC 72 ms
92,928 KB
testcase_10 AC 42 ms
59,008 KB
testcase_11 AC 50 ms
65,920 KB
testcase_12 AC 47 ms
62,208 KB
testcase_13 AC 38 ms
51,968 KB
testcase_14 AC 51 ms
66,048 KB
testcase_15 AC 45 ms
61,184 KB
testcase_16 AC 37 ms
52,224 KB
testcase_17 AC 36 ms
51,968 KB
testcase_18 AC 48 ms
66,176 KB
testcase_19 AC 51 ms
65,280 KB
testcase_20 AC 76 ms
94,336 KB
testcase_21 AC 78 ms
94,080 KB
testcase_22 AC 71 ms
93,056 KB
testcase_23 AC 74 ms
93,184 KB
testcase_24 AC 73 ms
93,056 KB
testcase_25 AC 73 ms
93,184 KB
testcase_26 AC 75 ms
92,928 KB
testcase_27 AC 76 ms
93,312 KB
testcase_28 AC 36 ms
52,352 KB
testcase_29 AC 37 ms
52,224 KB
testcase_30 AC 76 ms
93,952 KB
testcase_31 AC 74 ms
93,056 KB
testcase_32 AC 73 ms
93,184 KB
testcase_33 AC 78 ms
94,336 KB
testcase_34 AC 77 ms
94,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

se = set()
tot = 0
for a in A:
    tot += a
    se.add(tot)
    
cand = []
for i in range(1, int(tot ** 0.5 + 1)):
    if tot % i == 0:
        cand.append(i)
        if i != tot // i:
            cand.append(tot // i)
cand.sort()
for c in cand:
    if tot // c > n:
        continue
    ok = True
    for i in range(c, tot + 1, c):
        if i not in se:
            ok = False
            break
    if ok:
        print(tot // c)
        break
0