結果

問題 No.1242 高橋君とすごろく
コンテスト
ユーザー ayaoni
提出日時 2021-04-25 01:35:17
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
RE  
実行時間 -
コード長 809 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 151 ms
コンパイル使用メモリ 85,376 KB
実行使用メモリ 61,568 KB
最終ジャッジ日時 2026-03-25 17:00:53
合計ジャッジ時間 2,490 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 7 RE * 17
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


N,K = MI()
A = LI()

is_ok = [1]*(N+1)
for a in A:
    is_ok[a] = 0

for i in range(N-1,0,-1):
    if is_ok[i] == 0:
        continue
    for j in range(1,4):
        if i+j > N or is_ok[i+j] or i+(7-j) > N or is_ok[i+(7-j)]:
            continue
        else:
            is_ok[i] = 0
            break

if is_ok[1]:
    print('Yes')
else:
    print('No')
0