-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path1399A.cpp
More file actions
34 lines (25 loc) · 680 Bytes
/
Copy path1399A.cpp
File metadata and controls
34 lines (25 loc) · 680 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main() {
int t;
scanf("%d", &t);
while (t--) {
int n;
scanf("%d", &n);
int arr[105];
int start = INT_MAX, end = INT_MIN;
memset(arr, 0, sizeof(arr));
for (int i = 0; i < n; i++) {
int gg;
scanf("%d", &gg);
arr[gg]++;
start = min(start, gg);
end = max(end, gg);
}
bool checker = true;
for (int i = start; (i <= end) && checker; i++)
if (arr[i] <= 0) checker = false;
printf("%s\n", (checker) ? "YES" : "NO");
}
}