結果
| 問題 | No.290 1010 | 
| コンテスト | |
| ユーザー |  hiyokko2 | 
| 提出日時 | 2015-10-16 22:53:01 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 21 ms / 5,000 ms | 
| コード長 | 544 bytes | 
| コンパイル時間 | 681 ms | 
| コンパイル使用メモリ | 59,120 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-21 20:03:33 | 
| 合計ジャッジ時間 | 1,448 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 24 | 
ソースコード
#include <cstdio>
#include <iostream>
#include <algorithm>
#define rep(i,n) for(int i=0; i<n; i++)
#define REP(n) rep(i,n)
typedef long long ll;
using namespace std;
signed main()
{
	int N;
	string S;
	
	cin >> N >> S;
	int l = S.length();
	if (l == 1)
	{
		cout << "NO" << endl;
	} else if (l == 2) {
		if (S == "00" || S == "11") cout << "YES" << endl;
		else cout << "NO" << endl;
	} else if (l == 3) {
		if (S == "101" || S == "010") cout << "NO" << endl;
		else cout << "YES" << endl;
	} else {
		cout << "YES" << endl;
	}
	
	return 0;
}
            
            
            
        