結果
| 問題 |
No.99 ジャンピング駒
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-09-24 13:27:26 |
| 言語 | Python2 (2.7.18) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 395 bytes |
| コンパイル時間 | 47 ms |
| コンパイル使用メモリ | 6,784 KB |
| 実行使用メモリ | 14,868 KB |
| 最終ジャッジ日時 | 2024-11-17 20:37:32 |
| 合計ジャッジ時間 | 7,856 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 RE * 4 |
ソースコード
#!/usr/bin/python # -*- coding: utf-8 -*- 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: subcheck(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)