結果

問題 No.944 煎っぞ!
ユーザー pekempeypekempey
提出日時 2019-12-07 00:08:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 103 ms / 3,000 ms
コード長 365 bytes
コンパイル時間 270 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 88,924 KB
最終ジャッジ日時 2023-08-25 18:27:41
合計ジャッジ時間 4,635 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
88,524 KB
testcase_01 AC 90 ms
88,776 KB
testcase_02 AC 88 ms
88,432 KB
testcase_03 AC 88 ms
88,892 KB
testcase_04 AC 89 ms
88,872 KB
testcase_05 AC 89 ms
88,592 KB
testcase_06 AC 89 ms
88,768 KB
testcase_07 AC 89 ms
88,504 KB
testcase_08 AC 89 ms
88,440 KB
testcase_09 AC 89 ms
88,428 KB
testcase_10 AC 75 ms
75,908 KB
testcase_11 AC 77 ms
76,764 KB
testcase_12 AC 75 ms
75,752 KB
testcase_13 AC 69 ms
71,084 KB
testcase_14 AC 76 ms
76,816 KB
testcase_15 AC 76 ms
75,760 KB
testcase_16 AC 69 ms
70,880 KB
testcase_17 AC 70 ms
70,888 KB
testcase_18 AC 76 ms
76,660 KB
testcase_19 AC 77 ms
76,388 KB
testcase_20 AC 90 ms
88,920 KB
testcase_21 AC 91 ms
88,924 KB
testcase_22 AC 90 ms
88,412 KB
testcase_23 AC 89 ms
88,728 KB
testcase_24 AC 90 ms
88,680 KB
testcase_25 AC 89 ms
88,456 KB
testcase_26 AC 89 ms
88,484 KB
testcase_27 AC 94 ms
88,828 KB
testcase_28 AC 71 ms
71,284 KB
testcase_29 AC 71 ms
71,072 KB
testcase_30 AC 90 ms
88,792 KB
testcase_31 AC 103 ms
88,440 KB
testcase_32 AC 92 ms
88,820 KB
testcase_33 AC 93 ms
88,656 KB
testcase_34 AC 93 ms
88,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def divs(n):
  i = 1
  while i * i <= n:
    if n % i == 0:
      yield i
      yield n // i
    i += 1

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)
print(max(d for d in divs(S) if check(S // d)))

0