結果

問題 No.944 煎っぞ!
ユーザー AzumabashiAzumabashi
提出日時 2020-05-05 18:01:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 79 ms / 3,000 ms
コード長 484 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 10,712 KB
実行使用メモリ 19,040 KB
最終ジャッジ日時 2023-09-09 05:46:58
合計ジャッジ時間 4,070 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
18,948 KB
testcase_01 AC 61 ms
18,916 KB
testcase_02 AC 61 ms
18,952 KB
testcase_03 AC 62 ms
18,984 KB
testcase_04 AC 62 ms
19,004 KB
testcase_05 AC 62 ms
19,040 KB
testcase_06 AC 66 ms
18,880 KB
testcase_07 AC 61 ms
18,896 KB
testcase_08 AC 62 ms
18,868 KB
testcase_09 AC 62 ms
18,988 KB
testcase_10 AC 15 ms
7,828 KB
testcase_11 AC 26 ms
12,040 KB
testcase_12 AC 21 ms
9,656 KB
testcase_13 AC 15 ms
7,816 KB
testcase_14 AC 26 ms
11,948 KB
testcase_15 AC 20 ms
9,244 KB
testcase_16 AC 15 ms
7,788 KB
testcase_17 AC 15 ms
7,788 KB
testcase_18 AC 27 ms
11,864 KB
testcase_19 AC 27 ms
12,060 KB
testcase_20 AC 67 ms
18,840 KB
testcase_21 AC 68 ms
18,964 KB
testcase_22 AC 60 ms
18,680 KB
testcase_23 AC 61 ms
18,712 KB
testcase_24 AC 60 ms
18,644 KB
testcase_25 AC 60 ms
18,764 KB
testcase_26 AC 60 ms
18,640 KB
testcase_27 AC 64 ms
18,660 KB
testcase_28 AC 15 ms
7,896 KB
testcase_29 AC 14 ms
7,812 KB
testcase_30 AC 67 ms
18,760 KB
testcase_31 AC 79 ms
18,792 KB
testcase_32 AC 66 ms
18,832 KB
testcase_33 AC 65 ms
18,860 KB
testcase_34 AC 68 ms
18,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    beans = int(input())
    value = list(map(int, input().split()))
    for i in range(1, beans):
        value[i] += value[i - 1]
    val_set = set(value)
    answer = 1
    for i in range(beans):
        if value[-1] % value[i] == 0:
            j = 1
            while value[i] * j in val_set:
                j += 1
            if value[i] * (j - 1) == value[-1]:
                answer = max(answer, j - 1)
    print(answer)


if __name__ == '__main__':
    main()

0