Submission #1091425


Source Code Expand

Copy
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Globalization;
using System.Diagnostics;

class Myon
{
    static Scanner cin;
    public Myon() { }
    public static int Main()
    {
        cin = new Scanner();
        new Myon().calc();
        return 0;
    }
    
    public void calc()
    {
        int N = cin.nextInt();
        int odd = 0;
        for (int i = 0; i < N; i++)
        {
            int num = cin.nextInt();
            if (num % 2 == 1) odd++;
        }
        if (odd % 2 == 0) Console.WriteLine("YES");
        else Console.WriteLine("NO");
    }
    
}

class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        while (i >= s.Length)
        {
            string st = Console.ReadLine();
            while (st == "") st = Console.ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
        }
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }

}

Submission Info

Submission Time
Task A - Addition
User chokudai
Language C# (Mono 4.6.2.0)
Score 300
Code Size 1436 Byte
Status
Exec Time 78 ms
Memory 15576 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample1.txt, sample2.txt
All 300 / 300 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 78 ms 15576 KB
in10.txt 78 ms 15576 KB
in11.txt 19 ms 2648 KB
in12.txt 20 ms 2648 KB
in2.txt 77 ms 15576 KB
in3.txt 78 ms 15576 KB
in4.txt 78 ms 15576 KB
in5.txt 78 ms 15576 KB
in6.txt 78 ms 15576 KB
in7.txt 77 ms 15576 KB
in8.txt 78 ms 15576 KB
in9.txt 77 ms 15576 KB
sample1.txt 20 ms 2648 KB
sample2.txt 20 ms 2648 KB