Code
#include<bits/stdc++.h>
using namespace std;
void ans();
int main(){
int t; cin >> t;
while(t--) ans();
}
void ans() {
int n; cin >> n;
int arr[n+1];
for(int i=0;i<n;i++) cin >> arr[i];
int ok=0;
for(int i=0;i<n-1;i++){
if(arr[i]==arr[i+1]){
ok=1;
break;
}
}
if(ok==0) cout << "YES" << endl;
else cout << "NO" << endl;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1055 Array Permutation
- Contest
- Brain Booster #3
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2024-05-06 16:14:45
- Judged At
- 2024-11-11 03:33:19
- Judged By
- Score
- 0
- Total Time
- 2ms
- Peak Memory
- 324.0 KiB