-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJ02037.java
More file actions
35 lines (32 loc) · 1.02 KB
/
Copy pathJ02037.java
File metadata and controls
35 lines (32 loc) · 1.02 KB
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
import java.util.*;
import java.math.*;
public class J02037 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
sc.nextLine();
while (t-- >0) {
String s = sc.nextLine();
ArrayList<BigInteger> a = new ArrayList<>();
String[] x = s.split("\\s+");
int cnt = x.length;
int chan = 0;
int le = 0;
for (String i : x) {
int tmp = i.charAt(i.length()-1) - '0';
if (tmp == 0 || tmp == 2 || tmp == 4 || tmp == 6 || tmp == 8) {
chan ++;
} else {
le++;
}
}
if (cnt % 2 == 0 && chan >le) {
System.out.println("YES");
} else if (cnt % 2 == 1 && le > chan) {
System.out.println("YES");
} else {
System.out.println("NO");
}
}
}
}