結果
| 問題 | No.944 煎っぞ! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-11 00:04:48 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 73 ms / 3,000 ms |
| コード長 | 546 bytes |
| 記録 | |
| コンパイル時間 | 459 ms |
| コンパイル使用メモリ | 85,500 KB |
| 実行使用メモリ | 99,712 KB |
| 最終ジャッジ日時 | 2026-05-21 09:57:18 |
| 合計ジャッジ時間 | 4,092 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
from bisect import bisect_left
n = int(input())
A = list(map(int, input().split()))
sumA = sum(A)
accumA = [0]
for i in range(n):
accumA.append(accumA[-1] + A[i])
for i in range(n, 0, -1):
if sumA % i != 0:
continue
res = sumA // i
cnt = 0
idx = 0
pre_idx = 0
while pre_idx < n:
idx = bisect_left(accumA, res + accumA[pre_idx])
if idx == n + 1 or accumA[idx] != res + accumA[pre_idx]:
break
cnt += 1
pre_idx = idx
if cnt == i:
print(i)
exit()