-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path1360C.cpp
More file actions
48 lines (43 loc) · 1002 Bytes
/
1360C.cpp
File metadata and controls
48 lines (43 loc) · 1002 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <cstdio>
#include <vector>
#define DEBUG
#define MAXN 10000000
#define MULTIPLE(i, j, k) lake[i] * lake[j] * lake[k]
#define ll long long int
#include <bits/stdc++.h>
using namespace std;
int main() {
#ifdef DEBUG
freopen("in.in", "r", stdin);
#endif
ios_base::sync_with_stdio(0);
cin.tie(0);
int n ;
cin >> n ;
while (n--) {
int a ;
cin >> a;
vector<int > v(a, 0);
//for (auto &it : v) cin >> it;
int even = 0, odd = 0;
bool con = false;
vector<bool > m(120, false);
for (int i = 0; i < a; ++i) {
int temp;
cin >> temp;
if (temp % 2) {
odd++;
} else {
even++;
}
m[temp] = true;
if (m[temp-1] || m[temp+1]) con = true;
}
if (odd % 2 == 0 || con) {
cout << "YES" << endl;
continue;
}
cout << "NO" << endl;
}
return 0;
}