結果

問題 No.1242 高橋君とすごろく
ユーザー ayaoniayaoni
提出日時 2021-04-25 01:35:17
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 809 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 86,884 KB
実行使用メモリ 78,132 KB
最終ジャッジ日時 2023-09-17 13:56:57
合計ジャッジ時間 5,605 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,452 KB
testcase_01 AC 74 ms
71,172 KB
testcase_02 AC 74 ms
71,000 KB
testcase_03 AC 74 ms
71,000 KB
testcase_04 AC 73 ms
71,396 KB
testcase_05 AC 74 ms
71,456 KB
testcase_06 AC 73 ms
71,456 KB
testcase_07 AC 74 ms
71,460 KB
testcase_08 AC 73 ms
71,284 KB
testcase_09 AC 75 ms
71,456 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 AC 74 ms
71,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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