Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
137876 蔡胤泽 19老李吃水果 C++ Accepted 1 MS 280 KB 459 2025-11-23 10:33:13

Tests(5/5):


Code:

#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; }