結果

問題 No.1242 高橋君とすごろく
ユーザー googol_S0googol_S0
提出日時 2020-10-02 21:38:04
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 425 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 86,780 KB
実行使用メモリ 81,156 KB
最終ジャッジ日時 2023-09-23 04:24:09
合計ジャッジ時間 4,711 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,316 KB
testcase_01 AC 78 ms
70,988 KB
testcase_02 AC 76 ms
71,188 KB
testcase_03 AC 75 ms
71,164 KB
testcase_04 AC 76 ms
71,188 KB
testcase_05 AC 77 ms
71,172 KB
testcase_06 AC 77 ms
71,280 KB
testcase_07 AC 74 ms
71,172 KB
testcase_08 AC 74 ms
71,384 KB
testcase_09 AC 76 ms
71,144 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 84 ms
76,416 KB
testcase_17 AC 83 ms
76,400 KB
testcase_18 AC 81 ms
76,660 KB
testcase_19 AC 84 ms
76,500 KB
testcase_20 AC 85 ms
76,388 KB
testcase_21 AC 84 ms
76,592 KB
testcase_22 AC 74 ms
70,976 KB
testcase_23 AC 76 ms
71,132 KB
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 AC 75 ms
71,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
A=list(map(int,input().split()))
for i in range(K):
  A[i]-=1
for i in range(K-1):
  if A[i+1]-A[i]>20:
    N-=A[i+1]-A[i]-20
    for j in range(K-1,i,-1):
      A[j]-=A[i+1]-A[i]-20
if N-A[-1]>20:
  N=A[-1]+20
A=set(A)
DP=[1]*(N+5)
for i in range(N-2,-1,-1):
  if i in A:
    DP[i]=0
    continue
  for j in range(1,7):
    DP[i]&=(DP[i+j]|DP[i+7-j])
if DP[0]:
  print('Yes')
else:
  print('No')
0