結果

問題 No.99 ジャンピング駒
ユーザー FVRChan
提出日時 2018-05-03 12:10:57
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 438 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 32,400 KB
最終ジャッジ日時 2024-06-28 00:43:04
合計ジャッジ時間 12,584 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other TLE * 1 -- * 5
権限があれば一括ダウンロードができます

ソースコード

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