我的A题通过了样例,而且完全按照题意模拟,为什么一个点也不对???
#include <bits/stdc++.h>
using namespace std;
int T, cnt;
bool flag;
string s;
void solve() {
cin >> s;
if (s[0] == 'D' && s[1] == 'X') {
printf("YES\n");
return;
}
flag = 0;
for (int i = 0; i < 17; i++) {
if (s[i] != s[i - 1]) {
cnt = 1;
} else {
cnt++;
if (cnt == 4) {
printf("YES\n");
return;
}
}
}
printf("NO\n");
return;
}
int main() {
scanf("%d", &T);
while (T--) {
solve();
}
return 0;
}