結果
問題 |
No.944 煎っぞ!
|
ユーザー |
![]() |
提出日時 | 2019-12-07 18:03:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 524 bytes |
コンパイル時間 | 801 ms |
コンパイル使用メモリ | 64,256 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-26 01:18:32 |
合計ジャッジ時間 | 2,568 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 34 WA * 1 |
ソースコード
#include <numeric> #include <iostream> using namespace std; int main() { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; int sum = accumulate(a, a+n, 0), ans = 1; for (int i = 1; i < sum; i++) { if (sum % i) continue; int m = sum / i; bool ok = true; for (int i = 0, s = 0; i < n; i++) { s += a[i]; if (s > m) { ok = false; break; } if (s == m) s = 0; } if (ok) ans = i; } cout << ans << endl; }