結果

問題 No.944 煎っぞ!
ユーザー 👑 hitonanodehitonanode
提出日時 2019-12-07 01:27:58
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 459 ms / 3,000 ms
コード長 653 bytes
コンパイル時間 1,574 ms
コンパイル使用メモリ 170,944 KB
実行使用メモリ 8,020 KB
最終ジャッジ日時 2023-08-25 19:59:13
合計ジャッジ時間 6,389 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
7,964 KB
testcase_01 AC 51 ms
7,796 KB
testcase_02 AC 56 ms
7,796 KB
testcase_03 AC 55 ms
7,860 KB
testcase_04 AC 67 ms
7,852 KB
testcase_05 AC 42 ms
7,848 KB
testcase_06 AC 47 ms
7,848 KB
testcase_07 AC 57 ms
7,848 KB
testcase_08 AC 73 ms
7,796 KB
testcase_09 AC 44 ms
7,732 KB
testcase_10 AC 5 ms
4,380 KB
testcase_11 AC 99 ms
4,376 KB
testcase_12 AC 42 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 99 ms
4,380 KB
testcase_15 AC 43 ms
4,380 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 98 ms
4,376 KB
testcase_19 AC 98 ms
4,376 KB
testcase_20 AC 231 ms
7,752 KB
testcase_21 AC 253 ms
7,796 KB
testcase_22 AC 46 ms
7,816 KB
testcase_23 AC 56 ms
7,864 KB
testcase_24 AC 73 ms
7,796 KB
testcase_25 AC 50 ms
7,748 KB
testcase_26 AC 48 ms
7,748 KB
testcase_27 AC 459 ms
7,840 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 2 ms
4,376 KB
testcase_30 AC 375 ms
7,736 KB
testcase_31 AC 23 ms
7,796 KB
testcase_32 AC 22 ms
8,020 KB
testcase_33 AC 179 ms
7,796 KB
testcase_34 AC 190 ms
7,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define REP(i, n) FOR(i,0,n)


int main()
{
    int N;
    cin >> N;
    int t = 0;
    unordered_set<int> s;
    while (N--)
    {
        int a;
        cin >> a;
        t += a;
        s.insert(t);
    }
    int ret = 1;
    FOR(i, 2, t + 1) if (t % i == 0)
    {
        bool f = true;
        FOR(j, 1, i + 1) if (!s.count(t / i * j)) f = false;
        if (f) ret = i;
    }
    cout << ret << endl;
}
0