結果

問題 No.99 ジャンピング駒
ユーザー mban
提出日時 2016-11-07 11:58:52
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 75 ms / 5,000 ms
コード長 535 bytes
コンパイル時間 872 ms
コンパイル使用メモリ 110,344 KB
実行使用メモリ 41,916 KB
最終ジャッジ日時 2024-11-25 03:48:46
合計ジャッジ時間 1,812 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

class Magatro
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        int cnt = 0;
        int[] X = Console.ReadLine().Split(' ').Select(s => (int.Parse(s) + 1000000000) % 2).ToArray();
        for(int i = 0; i < N; i++)
        {
            if (X[i] == 0)
            {
                cnt++;
            }
            else
            {
                cnt--;
            }
        }
        Console.WriteLine(Math.Abs(cnt));
    }
}
0