AtCoder Grand Contest 010

Submission #1358321

Source codeソースコード

using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.Diagnostics;
using Enu = System.Linq.Enumerable;

public class Program
{
    public void Solve()
    {
        int N = Reader.Int();
        var A = Reader.IntArray(N);
        Console.WriteLine(A.Count(a => a % 2 == 1) % 2 == 0 ? "YES" : "NO");
    }
}


class Entry { static void Main() { new Program().Solve(); } }
class Reader
{
    static TextReader reader = Console.In;
    static readonly char[] separator = { ' ' };
    static readonly StringSplitOptions op = StringSplitOptions.RemoveEmptyEntries;
    static string[] A = new string[0];
    static int i;
    static void Init() { Dispose(); A = new string[0]; }
    public static void Set(TextReader r) { Init(); reader = r; }
    public static void Set(string file) { Init(); reader = new StreamReader(file); }
    public static bool HasNext() { return CheckNext(); }
    public static string String() { return Next(); }
    public static int Int() { return int.Parse(Next()); }
    public static long Long() { return long.Parse(Next()); }
    public static double Double() { return double.Parse(Next()); }
    public static int[] IntLine() { return Array.ConvertAll(Split(Line()), int.Parse); }
    public static int[] IntArray(int N) { return Range(N, Int); }
    public static int[][] IntTable(int H) { return Range(H, IntLine); }
    public static string[] StringArray(int N) { return Range(N, Next); }
    public static string[][] StringTable(int N) { return Range(N, () => Split(Line())); }
    public static string Line() { return reader.ReadLine().Trim(); }
    public static T[] Range<T>(int N, Func<T> f) { var r = new T[N]; for (int i = 0; i < N; r[i++] = f()) ; return r; }
    public static void Dispose() { reader.Dispose(); }
    static string[] Split(string s) { return s.Split(separator, op); }
    static string Next() { CheckNext(); return A[i++]; }
    static bool CheckNext()
    {
        if (i < A.Length) return true;
        string line = reader.ReadLine();
        if (line == null) return false;
        if (line == "") return CheckNext();
        A = Split(line);
        i = 0;
        return true;
    }
}

Submission

Task問題 A - Addition
User nameユーザ名 eitaho
Created time投稿日時
Language言語 C# (Mono 4.6.2.0)
Status状態 AC
Score得点 300
Source lengthソースコード長 2266 Byte
File nameファイル名
Exec time実行時間 72 ms
Memory usageメモリ使用量 24540 KB

Test case

Set

Set name Score得点 / Max score Cases
Sample - 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,sample1.txt,sample2.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
in1.txt AC 71 ms 20320 KB
in10.txt AC 70 ms 20320 KB
in11.txt AC 21 ms 11220 KB
in12.txt AC 22 ms 11220 KB
in2.txt AC 71 ms 20320 KB
in3.txt AC 71 ms 20320 KB
in4.txt AC 71 ms 22368 KB
in5.txt AC 71 ms 20320 KB
in6.txt AC 71 ms 22368 KB
in7.txt AC 71 ms 20320 KB
in8.txt AC 72 ms 24416 KB
in9.txt AC 72 ms 24540 KB
sample1.txt AC 21 ms 11220 KB
sample2.txt AC 21 ms 11220 KB