結果
| 問題 | No.290 1010 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2016-01-01 00:34:13 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 20 ms / 5,000 ms | 
| コード長 | 817 bytes | 
| コンパイル時間 | 630 ms | 
| コンパイル使用メモリ | 91,644 KB | 
| 実行使用メモリ | 5,424 KB | 
| 最終ジャッジ日時 | 2024-09-19 09:02:19 | 
| 合計ジャッジ時間 | 1,835 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 24 | 
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <string>
#include <tuple>
#include <functional>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <map>
#include <random>
//#include "toollib.h"
#define INT_MAX 2147483647
#define Loop(i, n) for(int i = 0; i < (int)n; i++)
#pragma warning (disable:4018)
using namespace std;
typedef long long int lint;
typedef struct {
	int x;
	int y;
}coordinate;
//***** Main Program *****
int main() {
	int N;
	string S;
	cin >> N >> S;
	if (N == 1) cout << "NO" << endl;
	else if (N == 2) {
		if (S == "10" || S == "01") cout << "NO" << endl;
		else cout << "YES" << endl;
	}
	else if (N == 3) {
		if (S == "010" || S == "101") cout << "NO" << endl;
		else cout << "YES" << endl;
	}
	else cout << "YES" << endl;
	return 0;
}
            
            
            
        