結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
18,964 KB
testcase_01 AC 64 ms
19,016 KB
testcase_02 AC 64 ms
18,964 KB
testcase_03 AC 63 ms
18,908 KB
testcase_04 AC 63 ms
18,904 KB
testcase_05 AC 63 ms
18,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
"""
No.99 ジャンピング駒
https://yukicoder.me/problems/no/99

"""
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(even - odd))


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