結果
| 問題 | No.290 1010 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2016-06-07 18:04:28 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 21 ms / 5,000 ms | 
| コード長 | 393 bytes | 
| コンパイル時間 | 651 ms | 
| コンパイル使用メモリ | 61,604 KB | 
| 実行使用メモリ | 5,300 KB | 
| 最終ジャッジ日時 | 2024-10-08 17:31:21 | 
| 合計ジャッジ時間 | 1,540 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 24 | 
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main(void) {
	int N; cin >> N;
	string s; cin >> s;
	if (N >= 4) {
		cout << "YES" << endl;
		return 0;
	}
	if (N <= 3) {
		bool f = false;;
		for (int i = 0; i < N-1; ++i) {
			f = (f | (s[i] == s[i + 1]));
		}
		if (f) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}
            
            
            
        