結果

問題 No.944 煎っぞ!
ユーザー iqueue02iqueue02
提出日時 2019-12-07 00:32:28
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 496 bytes
コンパイル時間 1,943 ms
コンパイル使用メモリ 165,900 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-08-25 18:50:40
合計ジャッジ時間 3,139 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 13 ms
4,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 15 ms
4,376 KB
testcase_06 WA -
testcase_07 AC 14 ms
4,376 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 3 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 5 ms
4,376 KB
testcase_15 WA -
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 5 ms
4,376 KB
testcase_19 WA -
testcase_20 AC 18 ms
4,380 KB
testcase_21 AC 17 ms
4,376 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 14 ms
4,376 KB
testcase_32 AC 13 ms
4,380 KB
testcase_33 WA -
testcase_34 AC 15 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;

int main(){
  int n;
  cin >> n;
  vector<int> cum(n+1,0);
  rep(i,n) {
    int a;
    cin >> a;
    cum[i+1] = cum[i] + a;
  }
  
  int res = 0;
  for (int i = 1; i <= n; i++) {
    int x = cum[i];
    int y = cum[n] - cum[i];
    if (y % x != 0) continue;
    res = max(res, y / x + 1);
  }
  cout << res << endl;
  return 0;
}
0