結果

問題 No.290 1010
ユーザー femto
提出日時 2016-01-24 22:27:21
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 5 ms / 5,000 ms
コード長 467 bytes
コンパイル時間 510 ms
コンパイル使用メモリ 62,948 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-21 16:10:35
合計ジャッジ時間 1,368 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	string s;
	cin >> s >> s;
	for(int i = 0; i < s.size() - 1; i++) {
		if(s[i] == s[i + 1]) {
			cout << "YES" << endl;
			return 0;
		}
	}
	for(int i = 0; i + 3 < s.size(); i++) {
		if(s.substr(i, 4) == "1010" || s.substr(i, 4) == "0101") {
			cout << "YES" << endl;
			return 0;
		}
	}
	cout << "NO" << endl;
}
0