結果

問題 No.99 ジャンピング駒
ユーザー _matumo__matumo_
提出日時 2018-08-19 22:52:30
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 100 ms / 5,000 ms
コード長 528 bytes
コンパイル時間 840 ms
コンパイル使用メモリ 112,956 KB
実行使用メモリ 43,456 KB
最終ジャッジ日時 2024-05-01 15:20:47
合計ジャッジ時間 1,948 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
39,368 KB
testcase_01 AC 95 ms
39,496 KB
testcase_02 AC 96 ms
41,416 KB
testcase_03 AC 98 ms
43,456 KB
testcase_04 AC 97 ms
41,548 KB
testcase_05 AC 96 ms
41,428 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace YukiCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int n0 = int.Parse(Console.ReadLine());
            var na = Console.ReadLine().Split().Select(long.Parse);
            long nEvn = na.Count(n => Math.Abs(n) % 2 == 0);
            long nOdd = na.Count(n => Math.Abs(n) % 2 == 1);
            Console.WriteLine(Math.Abs(nEvn - nOdd));
            Console.ReadLine();
        }
    }
}
0