結果

問題 No.99 ジャンピング駒
ユーザー mbanmban
提出日時 2016-11-07 11:58:52
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 112 ms / 5,000 ms
コード長 535 bytes
コンパイル時間 2,142 ms
コンパイル使用メモリ 105,256 KB
実行使用メモリ 37,992 KB
最終ジャッジ日時 2023-08-16 14:17:05
合計ジャッジ時間 3,652 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
35,976 KB
testcase_01 AC 110 ms
37,992 KB
testcase_02 AC 109 ms
37,876 KB
testcase_03 AC 112 ms
36,104 KB
testcase_04 AC 108 ms
37,916 KB
testcase_05 AC 109 ms
35,968 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;

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