結果

問題 No.944 煎っぞ!
ユーザー mkawa2mkawa2
提出日時 2019-12-08 17:19:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 59 ms / 3,000 ms
コード長 888 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,872 KB
実行使用メモリ 18,632 KB
最終ジャッジ日時 2023-08-29 04:22:16
合計ジャッジ時間 5,657 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
18,080 KB
testcase_01 AC 52 ms
18,076 KB
testcase_02 AC 52 ms
18,152 KB
testcase_03 AC 51 ms
18,104 KB
testcase_04 AC 52 ms
18,104 KB
testcase_05 AC 51 ms
18,032 KB
testcase_06 AC 55 ms
18,068 KB
testcase_07 AC 52 ms
18,228 KB
testcase_08 AC 52 ms
18,112 KB
testcase_09 AC 52 ms
18,196 KB
testcase_10 AC 17 ms
8,388 KB
testcase_11 AC 26 ms
11,992 KB
testcase_12 AC 21 ms
9,564 KB
testcase_13 AC 16 ms
7,888 KB
testcase_14 AC 25 ms
12,056 KB
testcase_15 AC 20 ms
9,420 KB
testcase_16 AC 16 ms
7,956 KB
testcase_17 AC 16 ms
7,844 KB
testcase_18 AC 25 ms
11,972 KB
testcase_19 AC 25 ms
12,056 KB
testcase_20 AC 58 ms
18,208 KB
testcase_21 AC 59 ms
18,512 KB
testcase_22 AC 50 ms
18,252 KB
testcase_23 AC 50 ms
18,244 KB
testcase_24 AC 51 ms
18,240 KB
testcase_25 AC 50 ms
18,320 KB
testcase_26 AC 51 ms
18,292 KB
testcase_27 AC 57 ms
18,248 KB
testcase_28 AC 16 ms
7,848 KB
testcase_29 AC 16 ms
7,888 KB
testcase_30 AC 59 ms
18,632 KB
testcase_31 AC 54 ms
18,376 KB
testcase_32 AC 50 ms
18,192 KB
testcase_33 AC 57 ms
18,296 KB
testcase_34 AC 57 ms
18,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    n = int(input())
    aa = LI()
    s = sum(aa)
    div = []
    for d in range(1, s):
        if d ** 2 > s: break
        if s % d: continue
        if d >= s // n: div.append(d)
        if s // d >= s // n: div.append(s // d)
    if len(div) > 1 and div[-1] == div[-2]:
        div.pop()
    div.sort()
    #print(div)
    cs=set()
    a=0
    for i in range(n):
        a+=aa[i]
        cs.add(a)
    #print(cs)
    for d in div:
        for kd in range(d,s+1,d):
            if kd not in cs:
                break
        else:
            print(s//d)
            break

main()
0