結果

問題 No.944 煎っぞ!
ユーザー pekempeypekempey
提出日時 2019-12-07 00:05:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 101 ms / 3,000 ms
コード長 435 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 89,216 KB
最終ジャッジ日時 2023-08-25 18:24:16
合計ジャッジ時間 4,952 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
88,744 KB
testcase_01 AC 90 ms
88,716 KB
testcase_02 AC 89 ms
88,672 KB
testcase_03 AC 90 ms
88,900 KB
testcase_04 AC 90 ms
88,640 KB
testcase_05 AC 88 ms
88,760 KB
testcase_06 AC 90 ms
88,796 KB
testcase_07 AC 90 ms
88,792 KB
testcase_08 AC 91 ms
88,732 KB
testcase_09 AC 90 ms
88,676 KB
testcase_10 AC 76 ms
76,176 KB
testcase_11 AC 78 ms
77,168 KB
testcase_12 AC 75 ms
76,032 KB
testcase_13 AC 71 ms
71,212 KB
testcase_14 AC 78 ms
77,000 KB
testcase_15 AC 77 ms
75,892 KB
testcase_16 AC 70 ms
71,228 KB
testcase_17 AC 70 ms
71,280 KB
testcase_18 AC 78 ms
77,168 KB
testcase_19 AC 79 ms
76,596 KB
testcase_20 AC 93 ms
89,040 KB
testcase_21 AC 91 ms
88,944 KB
testcase_22 AC 91 ms
88,968 KB
testcase_23 AC 90 ms
88,872 KB
testcase_24 AC 89 ms
88,756 KB
testcase_25 AC 88 ms
88,692 KB
testcase_26 AC 91 ms
88,512 KB
testcase_27 AC 93 ms
89,100 KB
testcase_28 AC 70 ms
71,200 KB
testcase_29 AC 70 ms
71,444 KB
testcase_30 AC 89 ms
89,216 KB
testcase_31 AC 101 ms
88,636 KB
testcase_32 AC 95 ms
88,924 KB
testcase_33 AC 93 ms
88,976 KB
testcase_34 AC 92 ms
89,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def divs(n):
  i = 1
  res = []
  while i * i <= n:
    if n % i == 0:
      res.append(i)
      res.append(n // i)
    i += 1
  return res


def check(x):
  i = 0
  while i < N:
    s = 0
    while i < N and s < x:
      s += A[i]
      i += 1
    if x != s: return False
  return True

S = sum(A)
ans = 0
for d in divs(S):
  if check(S // d):
    ans = max(ans, d)

print(ans)


0