結果

問題 No.944 煎っぞ!
ユーザー syunsukesyunsuke
提出日時 2020-09-16 22:06:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 117 ms / 3,000 ms
コード長 491 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 87,212 KB
実行使用メモリ 110,636 KB
最終ジャッジ日時 2023-09-04 04:02:42
合計ジャッジ時間 5,357 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
110,216 KB
testcase_01 AC 114 ms
110,188 KB
testcase_02 AC 113 ms
110,288 KB
testcase_03 AC 113 ms
110,216 KB
testcase_04 AC 113 ms
110,344 KB
testcase_05 AC 113 ms
110,052 KB
testcase_06 AC 114 ms
110,240 KB
testcase_07 AC 115 ms
110,172 KB
testcase_08 AC 113 ms
110,384 KB
testcase_09 AC 115 ms
110,172 KB
testcase_10 AC 79 ms
76,880 KB
testcase_11 AC 83 ms
80,228 KB
testcase_12 AC 80 ms
77,552 KB
testcase_13 AC 72 ms
71,500 KB
testcase_14 AC 82 ms
80,344 KB
testcase_15 AC 79 ms
77,004 KB
testcase_16 AC 72 ms
71,488 KB
testcase_17 AC 74 ms
71,700 KB
testcase_18 AC 84 ms
80,040 KB
testcase_19 AC 82 ms
79,544 KB
testcase_20 AC 117 ms
110,636 KB
testcase_21 AC 115 ms
110,556 KB
testcase_22 AC 114 ms
110,252 KB
testcase_23 AC 115 ms
110,348 KB
testcase_24 AC 114 ms
110,284 KB
testcase_25 AC 112 ms
110,484 KB
testcase_26 AC 113 ms
110,148 KB
testcase_27 AC 114 ms
109,544 KB
testcase_28 AC 72 ms
71,940 KB
testcase_29 AC 73 ms
71,524 KB
testcase_30 AC 115 ms
110,420 KB
testcase_31 AC 114 ms
110,504 KB
testcase_32 AC 113 ms
110,376 KB
testcase_33 AC 117 ms
110,324 KB
testcase_34 AC 117 ms
110,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
a=list(map(int,input().split()))
SA=sum(a)
L=[]
F=0
for i in range(1,int(SA**0.5)+1):
    if SA%i==0:
        L.append(i)
        L.append(SA//i)
L=set(L)
L=list(L)
L.sort()
#print(L)
#print(a)
R=[0]
D={}
for i in range(N):
    D[R[-1]+a[i]]=1
    R.append(R[-1]+a[i])
    
#print(L)
for l in L:
    F=0
    for i in range(1,SA+1):
        if l*i>SA:
            break
        if l*i not in D:
            F=1
            break
    if F==0:
        print(SA//l)
        exit()
0