【codeforces】codeforces.982.A

題目大意:判斷是否有相鄰以及空餘座位
題目分析:前後的座位補成正常的座位就好了

#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s; int n;
	cin>>n>>s;
	s='0'+s+'0';
	if(s.find("000")==-1 && s.find("11")==-1)
	puts("Yes");
	else puts("No");
}
//By sri_akshya_18, contest: Codeforces Round #484 (Div. 2), problem: (A) Row, Accepted, #, Copy
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章