結果

問題 No.944 煎っぞ!
ユーザー ひばちひばち
提出日時 2019-12-07 13:39:47
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 898 bytes
コンパイル時間 1,543 ms
コンパイル使用メモリ 167,024 KB
実行使用メモリ 7,788 KB
最終ジャッジ日時 2023-08-26 16:41:46
合計ジャッジ時間 5,556 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

#define itn long long
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define rrep(i,n) for(int i=(int)(n);i>=0;--i)
#define debug(x) cout << #x << "=" << (x) << endl;
const ll MOD=1e9+7;

template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<typename T> void fail(T v){cout << v << endl;exit(0);}
//template end

void solve(){
  int N;
  cin>>N;
  vector<int> A(N+1);
  int c[1010101];
  rep(i,N){
    cin>>A[i+1];
    A[i+1]+=A[i];
    c[A[i+1]]++;
  }
  int res=0;
  for(int i=1;i<=N;i++){
    int r=1,s=A[i]<<1;
    while(c[s]){r++;s+=A[i];}
    chmax(res,r);
  }
  cout<<res<<endl;
}
 
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  solve();
  return 0;
}
0