結果

問題 No.1242 高橋君とすごろく
ユーザー marroncastlemarroncastle
提出日時 2020-10-02 22:32:43
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 427 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 81,904 KB
実行使用メモリ 848,900 KB
最終ジャッジ日時 2024-07-17 22:06:55
合計ジャッジ時間 3,577 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 6 MLE * 1 -- * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = list(map(int, input().split()))
from collections import defaultdict
d = defaultdict(lambda: [0]*7)
for a in A:
  d[a][0] = 1
while A:
  a = A.pop()
  for i in range(1,7):
    if a-i<=0:
      break
    if d[a-i][0]==1:
      continue
    if d[a-i][7-i]==1:
      d[a-i][0] = 1
      A.append(a-i)
    elif d[a-i][i]==0:
      d[a-i][i] = 1
if d[1][0]==0:
  print('Yes')
else:
  print('No')
0