結果

問題 No.99 ジャンピング駒
ユーザー turner18_jp
提出日時 2018-01-11 13:10:17
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 336 ms / 5,000 ms
コード長 306 bytes
コンパイル時間 463 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 21,864 KB
最終ジャッジ日時 2024-12-23 17:20:41
合計ジャッジ時間 1,774 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
l = list(map(int, input().split()))

for i in range(len(l), 0, -1):
  try:
    if not abs(l[i]-l[i-1]) % 2 == 0:
      try:
        if not l[i-2] == l[i-1]-1:
          l.pop(i)
          l.pop(i-1)
      except IndexError:
        continue
  except IndexError:
    continue

print(len(l))
0