結果
| 問題 | 
                            No.99 ジャンピング駒
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-02-26 09:31:25 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 468 bytes | 
| コンパイル時間 | 167 ms | 
| コンパイル使用メモリ | 82,428 KB | 
| 実行使用メモリ | 98,736 KB | 
| 最終ジャッジ日時 | 2024-07-04 04:56:37 | 
| 合計ジャッジ時間 | 19,357 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 5 TLE * 1 | 
ソースコード
N = int(input())
x_list = list(map(int, input().split()))
x_list.sort()
cnt0 = 0
cnt1 = len(x_list)
while cnt0 != cnt1:
    tmp = []
    while len(x_list) > 0:
        if len(x_list) == 1:
            tmp.append(x_list.pop(0))
            break
        x0 = x_list.pop(0)
        x1 = x_list.pop(0)
        if (x0 + x1) % 2 == 0:
            tmp.append(x0)
            x_list.insert(0, x1)
    x_list = tmp
    cnt0 = cnt1
    cnt1 = len(x_list)
print(len(x_list))