結果

問題 No.99 ジャンピング駒
コンテスト
ユーザー ABKZ
提出日時 2022-02-26 09:31:25
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 4,497 ms / 5,000 ms
コード長 468 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 328 ms
コンパイル使用メモリ 84,992 KB
実行使用メモリ 111,872 KB
最終ジャッジ日時 2026-03-25 13:22:50
合計ジャッジ時間 15,568 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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))
0