結果

問題 No.99 ジャンピング駒
ユーザー turner18_jpturner18_jp
提出日時 2018-01-11 13:10:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 300 ms / 5,000 ms
コード長 306 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 19,236 KB
最終ジャッジ日時 2023-08-25 10:49:34
合計ジャッジ時間 2,184 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
19,136 KB
testcase_01 AC 97 ms
19,132 KB
testcase_02 AC 133 ms
19,144 KB
testcase_03 AC 300 ms
19,152 KB
testcase_04 AC 77 ms
19,184 KB
testcase_05 AC 77 ms
19,236 KB
権限があれば一括ダウンロードができます

ソースコード

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