結果

問題 No.99 ジャンピング駒
ユーザー FVRChanFVRChan
提出日時 2018-05-03 12:10:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 438 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 10,820 KB
実行使用メモリ 23,712 KB
最終ジャッジ日時 2023-09-10 09:17:48
合計ジャッジ時間 12,792 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

n=input()
x=sorted(list(map(int,input().split(" "))))
while True:
    try:
        f=False
        for i in range(len(x)):
            x1,x2=x[i],x[i+1]
            if (x1+x2)%2==0 or (x1-1 in x and x2+1 in x):
                continue
            x.remove(x1)
            x.remove(x2)
            f=True
        if f==False:
            break
    except IndexError:
        if len(x)==1:
            break
        continue
print(len(x))
0