結果

問題 No.944 煎っぞ!
ユーザー roarisroaris
提出日時 2019-12-07 13:51:26
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 91 ms / 3,000 ms
コード長 555 bytes
コンパイル時間 2,389 ms
コンパイル使用メモリ 86,792 KB
実行使用メモリ 89,728 KB
最終ジャッジ日時 2023-08-26 17:08:20
合計ジャッジ時間 7,200 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
89,448 KB
testcase_01 AC 83 ms
89,424 KB
testcase_02 AC 87 ms
89,428 KB
testcase_03 AC 87 ms
89,408 KB
testcase_04 AC 86 ms
89,468 KB
testcase_05 AC 85 ms
89,512 KB
testcase_06 AC 86 ms
89,376 KB
testcase_07 AC 85 ms
89,244 KB
testcase_08 AC 88 ms
89,444 KB
testcase_09 AC 86 ms
89,688 KB
testcase_10 AC 71 ms
76,764 KB
testcase_11 AC 75 ms
77,696 KB
testcase_12 AC 74 ms
77,020 KB
testcase_13 AC 67 ms
71,312 KB
testcase_14 AC 75 ms
77,456 KB
testcase_15 AC 72 ms
76,468 KB
testcase_16 AC 69 ms
71,864 KB
testcase_17 AC 68 ms
71,796 KB
testcase_18 AC 73 ms
77,824 KB
testcase_19 AC 74 ms
77,392 KB
testcase_20 AC 88 ms
89,516 KB
testcase_21 AC 86 ms
89,640 KB
testcase_22 AC 85 ms
89,440 KB
testcase_23 AC 86 ms
89,488 KB
testcase_24 AC 89 ms
89,464 KB
testcase_25 AC 87 ms
89,532 KB
testcase_26 AC 87 ms
89,424 KB
testcase_27 AC 91 ms
89,664 KB
testcase_28 AC 67 ms
71,608 KB
testcase_29 AC 68 ms
71,632 KB
testcase_30 AC 88 ms
89,728 KB
testcase_31 AC 88 ms
89,492 KB
testcase_32 AC 88 ms
89,284 KB
testcase_33 AC 89 ms
89,572 KB
testcase_34 AC 90 ms
89,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def make_divisors(n):
    divs = []
    
    for i in range(1, int(n**0.5)+1):
        if n%i==0:
            divs.append(i)
            
            if i!=n//i:
                divs.append(n//i)

    return divs

N = int(input())
a = list(map(int, input().split()))
A = sum(a)
divs = make_divisors(A)
divs.sort()

for d in divs:
    acc = 0
    
    for i in range(N):
        acc += a[i]
        
        if acc<d:
            continue
        elif acc==d:
            acc = 0
        else:
            break
    else:
        print(A//d)
        exit()
0