Run ID:137876
提交时间:2025-11-23 10:33:13
#include <bits/stdc++.h> using namespace std; int main(){ int k; cin >> k; while(k>0) { int n; cin >> n; int b = 0; int a[10005]; for(int i = 1;i <= n;i++) { cin >> a[i]; } for(int j = 1;j <= n;j++) { if(a[j] == a[j + 1]&&a[j] == a[j - 1]) { b = 1; } } if(b == 1) { cout << "N" << endl; } else { cout << "Y" << endl; } k = k -1; } return 0; }