結果

問題 No.99 ジャンピング駒
ユーザー kokatsukokatsu
提出日時 2022-10-19 00:53:32
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 24 ms / 5,000 ms
コード長 210 bytes
コンパイル時間 2,139 ms
コンパイル使用メモリ 205,944 KB
実行使用メモリ 7,584 KB
最終ジャッジ日時 2023-09-04 18:34:51
合計ジャッジ時間 3,538 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
7,584 KB
testcase_01 AC 22 ms
7,328 KB
testcase_02 AC 22 ms
6,832 KB
testcase_03 AC 24 ms
7,560 KB
testcase_04 AC 22 ms
7,108 KB
testcase_05 AC 22 ms
6,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    int N;
    readf("%d\n", N);

    auto X = readln.chomp.split.to!(int[]);

    int cnt;
    foreach (x; X) cnt += (x % 2 == 0 ? 1 : -1);

    int res = cnt.abs;
    res.writeln;
}
0