結果

問題 No.944 煎っぞ!
ユーザー 東前頭十一枚目東前頭十一枚目
提出日時 2019-12-12 16:36:44
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 148 ms / 3,000 ms
コード長 471 bytes
コンパイル時間 1,271 ms
コンパイル使用メモリ 169,464 KB
実行使用メモリ 8,220 KB
最終ジャッジ日時 2023-09-07 09:05:15
合計ジャッジ時間 5,387 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
8,108 KB
testcase_01 AC 51 ms
8,004 KB
testcase_02 AC 44 ms
8,020 KB
testcase_03 AC 39 ms
8,008 KB
testcase_04 AC 80 ms
8,196 KB
testcase_05 AC 34 ms
8,068 KB
testcase_06 AC 35 ms
7,996 KB
testcase_07 AC 43 ms
8,000 KB
testcase_08 AC 81 ms
8,008 KB
testcase_09 AC 40 ms
8,112 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 14 ms
4,376 KB
testcase_12 AC 9 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 13 ms
4,380 KB
testcase_15 AC 8 ms
4,380 KB
testcase_16 AC 2 ms
4,384 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 14 ms
4,380 KB
testcase_19 AC 14 ms
4,376 KB
testcase_20 AC 42 ms
7,996 KB
testcase_21 AC 45 ms
7,988 KB
testcase_22 AC 46 ms
8,080 KB
testcase_23 AC 50 ms
8,000 KB
testcase_24 AC 106 ms
8,220 KB
testcase_25 AC 47 ms
8,056 KB
testcase_26 AC 35 ms
8,096 KB
testcase_27 AC 148 ms
7,736 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 2 ms
4,376 KB
testcase_30 AC 55 ms
8,000 KB
testcase_31 AC 44 ms
8,020 KB
testcase_32 AC 43 ms
8,008 KB
testcase_33 AC 58 ms
7,964 KB
testcase_34 AC 67 ms
8,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n; cin >> n;
	int sum = 0;
	set<int> st;
	for(int i = 0; i < n; ++i) {
		int a; cin >> a;
		sum += a;
		st.insert(sum);
	}
	for(int i = n; i > 1; --i) {
		if(sum % i != 0) continue;
		int tag = sum / i;
		bool flg = true;
		for(int j = tag; j < sum; j += tag) {
			if(st.find(j) == st.end()) {
				flg = false;
			}
		}
		if(flg) {
			cout << i << '\n';
			return 0;
		}
	}
	cout << 1 << '\n';
	return 0;
}
0