結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 10 ms
5,316 KB
testcase_12 AC 6 ms
4,564 KB
testcase_13 AC 1 ms
4,384 KB
testcase_14 WA -
testcase_15 AC 5 ms
4,384 KB
testcase_16 AC 2 ms
4,508 KB
testcase_17 AC 2 ms
4,388 KB
testcase_18 AC 10 ms
5,300 KB
testcase_19 AC 10 ms
5,292 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 49 ms
12,080 KB
testcase_28 AC 1 ms
4,380 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 251 ms
11,004 KB
testcase_32 AC 240 ms
10,884 KB
testcase_33 AC 96 ms
12,348 KB
testcase_34 AC 95 ms
12,252 KB
権限があれば一括ダウンロードができます

ソースコード

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);
  map<int,int> c;
  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