結果

問題 No.99 ジャンピング駒
ユーザー ABKZABKZ
提出日時 2022-02-26 09:31:25
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 468 bytes
コンパイル時間 833 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 99,880 KB
最終ジャッジ日時 2023-09-17 08:12:05
合計ジャッジ時間 20,149 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,905 ms
94,568 KB
testcase_01 AC 1,888 ms
94,508 KB
testcase_02 AC 2,133 ms
94,464 KB
testcase_03 TLE -
testcase_04 AC 2,556 ms
99,880 KB
testcase_05 AC 2,558 ms
99,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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