結果

問題 No.1242 高橋君とすごろく
ユーザー maninimanini
提出日時 2021-01-25 21:43:28
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 826 bytes
コンパイル時間 422 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 71,560 KB
最終ジャッジ日時 2023-09-04 20:44:37
合計ジャッジ時間 4,025 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,396 KB
testcase_01 AC 66 ms
71,020 KB
testcase_02 WA -
testcase_03 AC 64 ms
71,352 KB
testcase_04 AC 67 ms
71,256 KB
testcase_05 AC 66 ms
71,116 KB
testcase_06 AC 66 ms
71,376 KB
testcase_07 AC 66 ms
71,292 KB
testcase_08 AC 68 ms
71,316 KB
testcase_09 AC 68 ms
71,256 KB
testcase_10 AC 68 ms
71,312 KB
testcase_11 AC 68 ms
71,196 KB
testcase_12 AC 68 ms
71,248 KB
testcase_13 AC 69 ms
71,140 KB
testcase_14 AC 70 ms
71,260 KB
testcase_15 AC 69 ms
71,328 KB
testcase_16 WA -
testcase_17 AC 69 ms
71,420 KB
testcase_18 AC 68 ms
71,392 KB
testcase_19 AC 68 ms
71,248 KB
testcase_20 AC 75 ms
71,472 KB
testcase_21 AC 68 ms
71,312 KB
testcase_22 AC 67 ms
71,360 KB
testcase_23 AC 68 ms
71,408 KB
testcase_24 AC 68 ms
71,320 KB
testcase_25 AC 68 ms
71,388 KB
testcase_26 AC 68 ms
71,200 KB
testcase_27 AC 68 ms
71,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 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