結果
| 問題 |
No.290 1010
|
| コンテスト | |
| ユーザー |
saytakaPC
|
| 提出日時 | 2015-10-16 23:59:19 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 749 bytes |
| コンパイル時間 | 1,210 ms |
| コンパイル使用メモリ | 160,708 KB |
| 実行使用メモリ | 13,888 KB |
| 最終ジャッジ日時 | 2024-07-22 06:44:45 |
| 合計ジャッジ時間 | 8,205 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 WA * 4 TLE * 1 -- * 3 |
ソースコード
#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;
}
saytakaPC