結果

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

ソースコード

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 + 4 < s.size(); i++) {
		if(s.substr(i, 4) == "1010" || s.substr(i, 4) == "0101") {
			cout << "YES" << endl;
			return 0;
		}
	}
	cout << "NO" << endl;
}
0