結果

問題 No.99 ジャンピング駒
ユーザー akihito0000akihito0000
提出日時 2016-09-24 13:25:02
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 347 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 14,996 KB
最終ジャッジ日時 2024-04-28 23:16:47
合計ジャッジ時間 1,354 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())
arr = map(int, raw_input().split())
arr.sort()

### sub
def subcheck(i):
	if len(arr) == i + 1:
		print len(arr)
		exit()
	if arr[i+1] % 2 == arr[i+2] % 2:
		sub(i+1)
	else:
		arr.pop(i+1)
		arr.pop(i+1)

### main
while len(arr) >= 2:
	if arr[0] % 2 == arr[1] % 2:
		subcheck(0)
	else:
		arr.pop(0)
		arr.pop(0)
print len(arr)
0