結果

問題 No.99 ジャンピング駒
ユーザー maspymaspy
提出日時 2020-01-21 13:54:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 50 ms / 5,000 ms
コード長 299 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 10,704 KB
実行使用メモリ 17,496 KB
最終ジャッジ日時 2023-09-19 03:26:11
合計ジャッジ時間 1,564 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
17,404 KB
testcase_01 AC 49 ms
17,352 KB
testcase_02 AC 50 ms
17,496 KB
testcase_03 AC 50 ms
17,408 KB
testcase_04 AC 49 ms
17,276 KB
testcase_05 AC 49 ms
17,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# 偶奇が両方あれば、必ず消せることがわかる

N,*A = map(int,read().split())

od = sum(x&1 for x in A)
ev = N - od

x = min(od, ev)
answer = N - 2 * x
print(answer)
0