結果

問題 No.290 1010
ユーザー saytakaPCsaytakaPC
提出日時 2015-10-16 23:59:19
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 749 bytes
コンパイル時間 1,107 ms
コンパイル使用メモリ 144,548 KB
実行使用メモリ 12,672 KB
最終ジャッジ日時 2023-09-29 12:23:41
合計ジャッジ時間 8,202 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(a) (a).begin(),(a).end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
const int INF=1e9;
const int MOD=100000;
int B=1000000;
int main(){
      int n;
      string s;
      int cnt[1000000];
      cin>>n>>s;
      REP(i,s.size()){
            cnt[i]=s[i]-'0';
            if(i!=0)cnt[i]+=cnt[i-1];
      }
      bool f=false;
      REP(i,n){
            for(int j=i;j+j+1-i<n;j++){
                  if(cnt[j]-cnt[i]==cnt[j+j+1-i]-cnt[j+1])f=true;
            }
      }
      if(f)cout<<"YES"<<endl;
      else cout<<"NO"<<endl;
}
0