結果
問題 | No.99 ジャンピング駒 |
ユーザー | mrc1031 |
提出日時 | 2016-10-12 10:19:25 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 114 ms / 5,000 ms |
コード長 | 522 bytes |
コンパイル時間 | 2,123 ms |
コンパイル使用メモリ | 105,992 KB |
実行使用メモリ | 38,648 KB |
最終ジャッジ日時 | 2023-08-14 07:39:54 |
合計ジャッジ時間 | 3,633 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 112 ms
34,572 KB |
testcase_01 | AC | 112 ms
36,688 KB |
testcase_02 | AC | 112 ms
38,648 KB |
testcase_03 | AC | 114 ms
36,612 KB |
testcase_04 | AC | 113 ms
36,660 KB |
testcase_05 | AC | 114 ms
36,592 KB |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Linq; class Program { static void Main(string[] args) { // No.99 ジャンピング駒 int N = int.Parse(Console.ReadLine()); long[] X = Console.ReadLine().Split(' ').Select(s => long.Parse(s)).ToArray(); int odd = 0, even = 0; for (int i = 0; i < X.Length; i++) { if (Math.Abs(X[i] % 2) == 1) odd++; else even++; } Console.WriteLine(Math.Abs(odd-even)); } }