题解
2023-06-27 19:29:22
发布于:上海
79阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
for (int i = 0; i < t; i++)
{
int n;
cin >> n;
int arr[n];
for (int j = 0; j < n; j++)
cin >> arr[j];
int sum = 0;
for (int a = 0; a < n; a++)
{
int count = arr[a];
for (int b = a + 1; b < n; b++)
if (arr[b] == arr[a])
sum = 1;
}
if (sum == 0)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
return 0;
}
这里空空如也
有帮助,赞一个