結果
問題 | No.944 煎っぞ! |
ユーザー |
![]() |
提出日時 | 2021-01-18 09:44:57 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 66 ms / 3,000 ms |
コード長 | 640 bytes |
コンパイル時間 | 151 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 80,348 KB |
最終ジャッジ日時 | 2024-11-30 20:46:42 |
合計ジャッジ時間 | 3,259 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
def make_divisors(n): lower_divisors , upper_divisors = [], [] i = 1 while i*i <= n: if n % i == 0: lower_divisors.append(i) if i != n // i: upper_divisors.append(n//i) i += 1 return lower_divisors + upper_divisors[::-1] N = int(input()) A = list(map(int,input().split())) SUMA = sum(A) D = make_divisors(SUMA) lower = max(A) for d in D: if lower<=d: temp = 0 for a in A: temp += a if temp>d: break if temp==d: temp = 0 else: print(SUMA//d) exit()