萌新求助红题
查看原帖
萌新求助红题
401052
Endline楼主2022/8/10 22:50

rt

#include<bits/stdc++.h>
using namespace std;
int T;
string str;
inline bool check()
{
	if(str[0]=='D'&&str[1]=='X')return true;
	for(int i=2;i<str.size()-3;i++)
		if(str[i]==str[i+1]&&str[i+1]==str[i+2]&&str[i+2]==str[i+3])return true;
	return false;
}
int main()
{
	ios::sync_with_stdio(false);
	cin>>T;
	while(T--)
	{
		cin>>str;
		puts(check()?"Yes":"No");
	}
	return 0;
}
2022/8/10 22:50
加载中...