Submission #1091900
Source Code Expand
#include <stdio.h> int main(void) { int gusu = 0, kisu = 0; int N, A, i; if (scanf("%d", &N) != 1) return 1; for (i = 0; i < N; i++) { if (scanf("%d", &A) != 1) return 1; if (A % 2 == 0) gusu++; else kisu++; } puts(kisu % 2 == 0 || (gusu == 0 && kisu == 1) ? "YES" : "NO"); return 0; } /* gusu + gusu = gusu kisu + kisu = gusu gusu + kisu = kisu <- tukaenai kisu + gusu = kisu <- tukaenai 偶奇が等しい数を選択する->奇数が奇数個だと1個取り残される 偶数はいくらでもたせる 奇数が1個 -> 自明にOK (2<=Nなので無いけど) 奇数が3個 -> 偶数1個と奇数1個に鳴るのでNG */
Submission Info
Submission Time | |
---|---|
Task | A - Addition |
User | mikecat |
Language | C (GCC 5.4.1) |
Score | 300 |
Code Size | 665 Byte |
Status | AC |
Exec Time | 14 ms |
Memory | 128 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 | 14 ms | 128 KB |
in10.txt | AC | 14 ms | 128 KB |
in11.txt | AC | 1 ms | 128 KB |
in12.txt | AC | 1 ms | 128 KB |
in2.txt | AC | 14 ms | 128 KB |
in3.txt | AC | 14 ms | 128 KB |
in4.txt | AC | 14 ms | 128 KB |
in5.txt | AC | 14 ms | 128 KB |
in6.txt | AC | 14 ms | 128 KB |
in7.txt | AC | 14 ms | 128 KB |
in8.txt | AC | 14 ms | 128 KB |
in9.txt | AC | 14 ms | 128 KB |
sample1.txt | AC | 1 ms | 128 KB |
sample2.txt | AC | 1 ms | 128 KB |