結果

問題 No.944 煎っぞ!
ユーザー brthyyjpbrthyyjp
提出日時 2020-12-17 13:53:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 3,000 ms
コード長 409 bytes
コンパイル時間 1,446 ms
コンパイル使用メモリ 81,496 KB
実行使用メモリ 79,952 KB
最終ジャッジ日時 2023-10-20 11:26:58
合計ジャッジ時間 4,872 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
78,988 KB
testcase_01 AC 68 ms
78,932 KB
testcase_02 AC 70 ms
78,496 KB
testcase_03 AC 70 ms
78,924 KB
testcase_04 AC 74 ms
79,024 KB
testcase_05 AC 68 ms
78,060 KB
testcase_06 AC 69 ms
78,764 KB
testcase_07 AC 71 ms
78,920 KB
testcase_08 AC 73 ms
79,420 KB
testcase_09 AC 66 ms
78,504 KB
testcase_10 AC 47 ms
58,964 KB
testcase_11 AC 55 ms
64,184 KB
testcase_12 AC 52 ms
62,188 KB
testcase_13 AC 40 ms
51,736 KB
testcase_14 AC 58 ms
64,164 KB
testcase_15 AC 51 ms
61,340 KB
testcase_16 AC 42 ms
51,736 KB
testcase_17 AC 40 ms
51,740 KB
testcase_18 AC 55 ms
64,568 KB
testcase_19 AC 56 ms
63,816 KB
testcase_20 AC 68 ms
79,408 KB
testcase_21 AC 70 ms
79,412 KB
testcase_22 AC 69 ms
78,848 KB
testcase_23 AC 71 ms
78,880 KB
testcase_24 AC 69 ms
78,988 KB
testcase_25 AC 69 ms
78,856 KB
testcase_26 AC 67 ms
78,452 KB
testcase_27 AC 70 ms
79,520 KB
testcase_28 AC 39 ms
51,720 KB
testcase_29 AC 39 ms
51,720 KB
testcase_30 AC 72 ms
79,484 KB
testcase_31 AC 65 ms
77,308 KB
testcase_32 AC 67 ms
78,376 KB
testcase_33 AC 72 ms
79,952 KB
testcase_34 AC 73 ms
79,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
s = sum(A)
for i in range(n):
    if s%(n-i) != 0:
        continue
    p = s//(n-i)
    #print(p)
    cur = 0
    flag = True
    for j in range(n):
        if cur+A[j]>p:
            flag=False
            break
        elif cur+A[j] == p:
            cur = 0
        else:
            cur += A[j]
    if flag:
        ans = i
        break
print(n-ans)
0