Submission #1091545
Source Code Expand
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); TaskA solver = new TaskA(); solver.solve(1, in, out); out.close(); } static class TaskA { public void solve(int testNumber, InputReader in, PrintWriter out) { int n = in.nextInt(); int n0 = 0; int n1 = 0; for (int i = 0; i < n; ++i) { if (in.nextInt() % 2 == 0) ++n0; else ++n1; } if (n1 % 2 == 0) { out.println("YES"); } else { out.println("NO"); } } } static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream), 32768); tokenizer = null; } public String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } } }
Submission Info
Submission Time | |
---|---|
Task | A - Addition |
User | Petr |
Language | Java8 (OpenJDK 1.8.0) |
Score | 300 |
Code Size | 2000 Byte |
Status | AC |
Exec Time | 241 ms |
Memory | 23472 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample1.txt, sample2.txt |
All | sample1.txt, sample2.txt, in1.txt, in10.txt, in11.txt, in12.txt, in2.txt, in3.txt, in4.txt, in5.txt, in6.txt, in7.txt, in8.txt, in9.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
in1.txt | AC | 241 ms | 23472 KB |
in10.txt | AC | 218 ms | 22732 KB |
in11.txt | AC | 99 ms | 8400 KB |
in12.txt | AC | 100 ms | 8400 KB |
in2.txt | AC | 216 ms | 22888 KB |
in3.txt | AC | 216 ms | 22896 KB |
in4.txt | AC | 204 ms | 22904 KB |
in5.txt | AC | 218 ms | 22732 KB |
in6.txt | AC | 235 ms | 23160 KB |
in7.txt | AC | 206 ms | 22904 KB |
in8.txt | AC | 216 ms | 22896 KB |
in9.txt | AC | 234 ms | 22624 KB |
sample1.txt | AC | 104 ms | 8400 KB |
sample2.txt | AC | 99 ms | 8400 KB |