結果

問題 No.99 ジャンピング駒
ユーザー kichirb3kichirb3
提出日時 2018-03-05 23:07:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 58 ms / 5,000 ms
コード長 538 bytes
コンパイル時間 66 ms
コンパイル使用メモリ 10,740 KB
実行使用メモリ 19,152 KB
最終ジャッジ日時 2023-10-11 20:34:55
合計ジャッジ時間 1,011 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
19,000 KB
testcase_01 AC 58 ms
19,000 KB
testcase_02 AC 56 ms
18,944 KB
testcase_03 AC 56 ms
19,152 KB
testcase_04 AC 55 ms
19,084 KB
testcase_05 AC 55 ms
18,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
"""
No.99 ジャンピング駒
https://yukicoder.me/problems/no/99
AC
"""
import sys
from sys import stdin
input = stdin.readline


def main(args):
    # 奇数と偶数はペアになって消滅するので、奇数・偶数の差分を求める
    N = int(input())
    numbers = [int(x) for x in input().split()]
    # even = sum([1 for x in numbers if x % 2 == 0])
    odd = sum([1 for x in numbers if x % 2 == 1])
    print(abs(len(numbers) - odd - odd))


if __name__ == '__main__':
    main(sys.argv[1:])
0