結果

問題 No.1242 高橋君とすごろく
ユーザー marroncastlemarroncastle
提出日時 2020-10-02 22:56:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 637 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 87,012 KB
実行使用メモリ 75,420 KB
最終ジャッジ日時 2023-09-27 08:44:30
合計ジャッジ時間 3,270 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,448 KB
testcase_01 AC 63 ms
71,336 KB
testcase_02 AC 65 ms
71,316 KB
testcase_03 AC 63 ms
71,284 KB
testcase_04 AC 65 ms
71,420 KB
testcase_05 AC 64 ms
71,388 KB
testcase_06 AC 65 ms
71,544 KB
testcase_07 AC 64 ms
71,260 KB
testcase_08 AC 64 ms
71,288 KB
testcase_09 AC 66 ms
71,588 KB
testcase_10 AC 67 ms
71,520 KB
testcase_11 AC 67 ms
71,472 KB
testcase_12 AC 66 ms
71,320 KB
testcase_13 AC 65 ms
71,404 KB
testcase_14 AC 68 ms
71,204 KB
testcase_15 AC 65 ms
71,408 KB
testcase_16 AC 67 ms
71,348 KB
testcase_17 AC 64 ms
71,392 KB
testcase_18 AC 67 ms
71,320 KB
testcase_19 AC 66 ms
71,424 KB
testcase_20 AC 67 ms
71,412 KB
testcase_21 AC 66 ms
71,336 KB
testcase_22 AC 72 ms
75,364 KB
testcase_23 AC 68 ms
75,420 KB
testcase_24 AC 66 ms
71,304 KB
testcase_25 AC 66 ms
71,592 KB
testcase_26 AC 66 ms
71,180 KB
testcase_27 AC 65 ms
71,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
from bisect import *
def binary_search(A,p):
  if A[0]<=p and p<=A[-1]:
    if p == A[bisect_left(A,p)]:
      return True
  return False

while A:
  if len(A)>=3 and A[-1]-A[-2]==A[-2]-A[-3]==1:
    print('No')
    break
  a = A.pop()
  if a==1:
    print('No')
    break
  lis = []
  while A:
    b = A.pop()
    lis.append(b)
    if a-b>5:
      break
    if (a-b)%2==1:
      p = b-(3-(a-b)//2)
      if p>=1:
        insort(A,p)
  for l in lis:
    if len(A)==0:
      A.append(l)
    elif not binary_search(A,l):
      insort(A,l)
else:
  print('Yes')

0