Code
#include<bits/stdc++.h>
using namespace std;
void ans();
int main() {
int t;
cin >> t;
while(t--)
ans();
return 0;
}
void ans() {
int n;
cin >> n;
vector<int> arr(n);
for(int i = 0; i < n; i++)
cin >> arr[i];
sort(arr.begin(),arr.end());
bool ok = false;
for(int i = 0; i < n - 1; i++) {
if(arr[i] == arr[i + 1]) {
ok = true;
break;
}
}
if(!ok)
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:19:48
- Judged At
- 2024-11-11 03:33:14
- Judged By
- Score
- 100
- Total Time
- 3ms
- Peak Memory
- 548.0 KiB