結果

問題 No.944 煎っぞ!
ユーザー 👑 KazunKazun
提出日時 2020-11-17 23:43:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 120 ms / 3,000 ms
コード長 562 bytes
コンパイル時間 371 ms
コンパイル使用メモリ 86,956 KB
実行使用メモリ 89,472 KB
最終ジャッジ日時 2023-09-30 14:32:05
合計ジャッジ時間 6,160 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
88,888 KB
testcase_01 AC 98 ms
88,956 KB
testcase_02 AC 94 ms
88,888 KB
testcase_03 AC 94 ms
89,188 KB
testcase_04 AC 94 ms
88,956 KB
testcase_05 AC 94 ms
89,052 KB
testcase_06 AC 92 ms
89,168 KB
testcase_07 AC 93 ms
89,124 KB
testcase_08 AC 94 ms
89,192 KB
testcase_09 AC 94 ms
89,192 KB
testcase_10 AC 81 ms
76,192 KB
testcase_11 AC 83 ms
77,188 KB
testcase_12 AC 86 ms
76,388 KB
testcase_13 AC 76 ms
71,444 KB
testcase_14 AC 85 ms
77,164 KB
testcase_15 AC 82 ms
76,268 KB
testcase_16 AC 73 ms
71,300 KB
testcase_17 AC 76 ms
71,312 KB
testcase_18 AC 85 ms
77,440 KB
testcase_19 AC 85 ms
77,160 KB
testcase_20 AC 106 ms
89,180 KB
testcase_21 AC 98 ms
89,472 KB
testcase_22 AC 96 ms
89,076 KB
testcase_23 AC 96 ms
88,888 KB
testcase_24 AC 97 ms
88,940 KB
testcase_25 AC 95 ms
88,916 KB
testcase_26 AC 97 ms
89,084 KB
testcase_27 AC 99 ms
89,456 KB
testcase_28 AC 72 ms
71,172 KB
testcase_29 AC 73 ms
71,308 KB
testcase_30 AC 96 ms
89,200 KB
testcase_31 AC 120 ms
88,896 KB
testcase_32 AC 100 ms
89,256 KB
testcase_33 AC 102 ms
89,260 KB
testcase_34 AC 105 ms
89,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#約数全部
def Divisors(N):
    N=abs(N)
    L,U=[],[]
    k=1
    while k*k <=N:
        if N%k== 0:
            L.append(k)
            if k*k!=N:
                U.append(N//k)
        k+=1
    return L+U[::-1]

#================================================
N=int(input())
A=list(map(int,input().split()))

D=Divisors(sum(A))

K=0
for d in D:
    M=0
    X=0
    Flag=True
    for a in A:
        X+=a
        if X>d:
            Flag=False
            break
        elif X==d:
            X=0
            M+=1

    if Flag:
        K=max(K,M)
print(K)
0