結果

問題 No.99 ジャンピング駒
ユーザー first_vilfirst_vil
提出日時 2020-11-06 09:16:23
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 76 ms / 5,000 ms
コード長 287 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 21,736 KB
最終ジャッジ日時 2024-07-22 11:40:35
合計ジャッジ時間 1,082 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

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