結果

問題 No.1242 高橋君とすごろく
ユーザー marroncastlemarroncastle
提出日時 2020-10-02 22:51:33
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 566 bytes
コンパイル時間 782 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 81,796 KB
最終ジャッジ日時 2023-09-24 22:23:58
合計ジャッジ時間 5,414 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,344 KB
testcase_01 AC 74 ms
71,132 KB
testcase_02 AC 74 ms
71,296 KB
testcase_03 AC 74 ms
71,224 KB
testcase_04 AC 74 ms
71,268 KB
testcase_05 AC 72 ms
71,360 KB
testcase_06 AC 74 ms
70,932 KB
testcase_07 AC 74 ms
71,136 KB
testcase_08 AC 72 ms
71,080 KB
testcase_09 AC 73 ms
71,296 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます

ソースコード

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:
  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