Skip to content

Instantly share code, notes, and snippets.

@qjatn0120
Created October 13, 2022 17:00
Show Gist options
  • Save qjatn0120/72b831eaa11166bc5dc58545ff8af21f to your computer and use it in GitHub Desktop.
Save qjatn0120/72b831eaa11166bc5dc58545ff8af21f to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
using namespace std;
int t, n, a[105];
int main(){
cin.tie(nullptr), ios::sync_with_stdio(false);
cin >> t;
while(t--){
cin >> n;
for(int i = 0; i< n; i++) cin >> a[i];
sort(a, a + n);
bool ans = true;
for(int i = 1; i < n; i++){
if(a[i - 1] == a[i]) ans = false;
}
cout << (ans ? "YES\n" : "NO\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment