結果

問題 No.944 煎っぞ!
ユーザー Konton7Konton7
提出日時 2019-12-17 23:21:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 167 ms / 3,000 ms
コード長 747 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 87,284 KB
実行使用メモリ 91,208 KB
最終ジャッジ日時 2023-09-18 06:55:13
合計ジャッジ時間 6,446 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
89,676 KB
testcase_01 AC 94 ms
89,684 KB
testcase_02 AC 95 ms
89,396 KB
testcase_03 AC 98 ms
89,652 KB
testcase_04 AC 97 ms
89,868 KB
testcase_05 AC 96 ms
89,956 KB
testcase_06 AC 95 ms
89,260 KB
testcase_07 AC 95 ms
89,524 KB
testcase_08 AC 96 ms
89,752 KB
testcase_09 AC 95 ms
89,892 KB
testcase_10 AC 80 ms
76,216 KB
testcase_11 AC 81 ms
77,136 KB
testcase_12 AC 83 ms
76,576 KB
testcase_13 AC 75 ms
71,364 KB
testcase_14 AC 83 ms
76,896 KB
testcase_15 AC 82 ms
76,640 KB
testcase_16 AC 76 ms
71,544 KB
testcase_17 AC 76 ms
71,072 KB
testcase_18 AC 83 ms
77,552 KB
testcase_19 AC 83 ms
77,216 KB
testcase_20 AC 97 ms
90,064 KB
testcase_21 AC 96 ms
90,080 KB
testcase_22 AC 94 ms
89,552 KB
testcase_23 AC 97 ms
89,560 KB
testcase_24 AC 100 ms
89,944 KB
testcase_25 AC 94 ms
89,856 KB
testcase_26 AC 95 ms
89,956 KB
testcase_27 AC 105 ms
89,848 KB
testcase_28 AC 76 ms
71,488 KB
testcase_29 AC 75 ms
71,416 KB
testcase_30 AC 97 ms
90,012 KB
testcase_31 AC 167 ms
90,268 KB
testcase_32 AC 142 ms
90,388 KB
testcase_33 AC 129 ms
91,208 KB
testcase_34 AC 128 ms
90,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
n = int(input())
num = [ int(v) for v in input().split() ]
ans = 1

def cumsum(inlist):
    s = 0
    outlist = []
    for i in inlist:
        s += i
        outlist.append(s)
    return outlist

def divisors(n):
    divisors_list = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors_list.append(i)
            divisors_list.append(n//i)
    divisors_list.sort()
    return divisors_list

num_cum = cumsum(num)
m = num_cum[-1]

for i in divisors(m):
    for j in range(1, m//i+1):
        status = True
        k = i*j
        if bisect.bisect_left(num_cum, k) == bisect.bisect_right(num_cum, k):
            status = False
            break
    if status == True:
        print(k//i)
        break
0