結果

問題 No.944 煎っぞ!
ユーザー ttrttr
提出日時 2020-02-01 22:43:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,147 ms / 3,000 ms
コード長 387 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 11,924 KB
実行使用メモリ 18,004 KB
最終ジャッジ日時 2023-10-19 00:24:44
合計ジャッジ時間 9,742 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 210 ms
12,500 KB
testcase_01 AC 194 ms
12,504 KB
testcase_02 AC 203 ms
12,500 KB
testcase_03 AC 201 ms
12,504 KB
testcase_04 AC 224 ms
12,520 KB
testcase_05 AC 183 ms
12,512 KB
testcase_06 AC 202 ms
12,516 KB
testcase_07 AC 204 ms
12,520 KB
testcase_08 AC 222 ms
12,508 KB
testcase_09 AC 181 ms
12,504 KB
testcase_10 AC 31 ms
10,152 KB
testcase_11 AC 62 ms
11,608 KB
testcase_12 AC 39 ms
10,840 KB
testcase_13 AC 30 ms
10,080 KB
testcase_14 AC 240 ms
11,600 KB
testcase_15 AC 36 ms
10,696 KB
testcase_16 AC 29 ms
10,080 KB
testcase_17 AC 29 ms
10,084 KB
testcase_18 AC 62 ms
11,608 KB
testcase_19 AC 60 ms
11,600 KB
testcase_20 AC 1,060 ms
17,444 KB
testcase_21 AC 1,145 ms
17,440 KB
testcase_22 AC 92 ms
11,872 KB
testcase_23 AC 103 ms
11,872 KB
testcase_24 AC 129 ms
11,872 KB
testcase_25 AC 100 ms
11,872 KB
testcase_26 AC 95 ms
11,872 KB
testcase_27 AC 78 ms
17,208 KB
testcase_28 AC 30 ms
10,076 KB
testcase_29 AC 29 ms
10,076 KB
testcase_30 AC 1,147 ms
18,004 KB
testcase_31 AC 74 ms
11,872 KB
testcase_32 AC 74 ms
11,872 KB
testcase_33 AC 78 ms
14,628 KB
testcase_34 AC 79 ms
14,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = [int(a) for a in input().split()]

SUM = sum(A)
i = max(A)
while i <= SUM:
    if SUM%i > 0:
        i += 1
        continue
    cnt = 0
    for j in range(N):
        if cnt < i:
            cnt += A[j]
        elif cnt == i:
            cnt = A[j]
        else:
            cnt = 0
            break
    if cnt == i:
        print(SUM//i)
        break
    i += 1
0