結果

問題 No.99 ジャンピング駒
ユーザー mokraimokrai
提出日時 2017-11-17 14:47:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 53 ms / 5,000 ms
コード長 332 bytes
コンパイル時間 544 ms
コンパイル使用メモリ 10,672 KB
実行使用メモリ 19,016 KB
最終ジャッジ日時 2023-08-16 19:08:36
合計ジャッジ時間 1,614 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
19,004 KB
testcase_01 AC 53 ms
18,928 KB
testcase_02 AC 52 ms
19,016 KB
testcase_03 AC 52 ms
19,008 KB
testcase_04 AC 52 ms
18,972 KB
testcase_05 AC 53 ms
18,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    nums = map(int, input().split())
    odd_count = 0
    even_count = 0

    for num in list(nums):
        if num % 2 == 0:
            even_count += 1
        else:
            odd_count += 1

    distance = odd_count - even_count
    print(abs(distance))

if __name__ == '__main__':
    main()
0