結果

問題 No.1242 高橋君とすごろく
ユーザー marroncastlemarroncastle
提出日時 2020-10-02 22:33:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 427 bytes
コンパイル時間 833 ms
コンパイル使用メモリ 10,928 KB
実行使用メモリ 188,488 KB
最終ジャッジ日時 2023-09-24 21:45:04
合計ジャッジ時間 4,077 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
13,068 KB
testcase_01 AC 19 ms
8,480 KB
testcase_02 AC 20 ms
8,488 KB
testcase_03 AC 19 ms
8,504 KB
testcase_04 AC 19 ms
8,540 KB
testcase_05 AC 19 ms
8,648 KB
testcase_06 AC 19 ms
8,536 KB
testcase_07 AC 19 ms
8,536 KB
testcase_08 AC 19 ms
8,604 KB
testcase_09 AC 19 ms
8,548 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()))
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