結果

問題 No.1242 高橋君とすごろく
コンテスト
ユーザー manini
提出日時 2021-01-25 21:43:28
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 826 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 184 ms
コンパイル使用メモリ 85,084 KB
実行使用メモリ 53,816 KB
最終ジャッジ日時 2026-03-06 23:31:31
合計ジャッジ時間 2,148 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 23 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# coding:UTF-8
import sys

MOD = 10 ** 9 + 7
INF = float('inf')

N, K = list(map(int, input().split()))     # スペース区切り連続数字
A = list(map(int, input().split()))     # スペース区切り連続数字

nums = set(A)

for a in A:
    if a == 2:
        if 1 not in nums and 7 in nums:
            print("No")
            exit()
    elif a == 3:
        if 2 not in nums and 8 in nums:
            print("No")
            exit()
        if 1 not in nums and 6 in nums:
            print("No")
            exit()
    else:
        if a - 1 not in nums and a + 5 in nums:
            print("No")
            exit()
        if a - 2 not in nums and a + 3 in nums:
            print("No")
            exit()
        if a - 3 not in nums and a + 1 in nums:
            print("No")
            exit()

print("Yes")
0