結果

問題 No.99 ジャンピング駒
ユーザー first_vilfirst_vil
提出日時 2020-11-06 09:16:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 52 ms / 5,000 ms
コード長 287 bytes
コンパイル時間 133 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 19,200 KB
最終ジャッジ日時 2023-09-29 17:39:01
合計ジャッジ時間 1,108 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
19,128 KB
testcase_01 AC 52 ms
19,036 KB
testcase_02 AC 49 ms
19,052 KB
testcase_03 AC 49 ms
19,152 KB
testcase_04 AC 47 ms
19,200 KB
testcase_05 AC 48 ms
19,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    import sys
    input=sys.stdin.readline
    n=int(input())
    odd=0;even=0
    for x in list(map(int,input().split())):
        if x&1:
            odd+=1
        else:
            even+=1
    if odd<even:
        print(even-odd)
    else:
        print(odd-even)
main()
0