結果

問題 No.1242 高橋君とすごろく
ユーザー daikisuyamadaikisuyama
提出日時 2020-10-03 12:17:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 641 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 87,228 KB
実行使用メモリ 71,560 KB
最終ジャッジ日時 2023-09-25 05:03:14
合計ジャッジ時間 3,513 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,360 KB
testcase_01 AC 67 ms
71,352 KB
testcase_02 AC 69 ms
71,496 KB
testcase_03 AC 68 ms
71,260 KB
testcase_04 AC 68 ms
71,068 KB
testcase_05 AC 69 ms
71,408 KB
testcase_06 AC 68 ms
71,496 KB
testcase_07 AC 68 ms
71,372 KB
testcase_08 AC 68 ms
71,496 KB
testcase_09 AC 69 ms
71,560 KB
testcase_10 AC 67 ms
71,292 KB
testcase_11 AC 68 ms
71,412 KB
testcase_12 AC 69 ms
71,376 KB
testcase_13 AC 69 ms
71,272 KB
testcase_14 AC 68 ms
71,168 KB
testcase_15 AC 69 ms
71,068 KB
testcase_16 AC 68 ms
71,352 KB
testcase_17 AC 72 ms
71,324 KB
testcase_18 AC 70 ms
71,404 KB
testcase_19 AC 69 ms
71,296 KB
testcase_20 WA -
testcase_21 AC 69 ms
71,516 KB
testcase_22 AC 73 ms
71,536 KB
testcase_23 AC 70 ms
71,412 KB
testcase_24 AC 69 ms
71,292 KB
testcase_25 AC 70 ms
71,252 KB
testcase_26 AC 70 ms
71,372 KB
testcase_27 AC 68 ms
71,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
a=list(map(int,input().split()))
b=set(a)
for i in range(k-1,-1,-1):
    if a[i]<=8:
        break
    else:
        if a[i]+1 in b:
            print("No")
            exit()
        if a[i]+3 in b:
            print("No")
            exit()
        if a[i]+5 in b:
            print("No")
            exit()
for j in range(8,0,-1):
    if j in b:
        if j+1 in b:
            if j-3>=1:
                b.add(j-3)
        if j+3 in b:
            if j-2>=1:
                b.add(j-2)
        if j+5 in b:
            if j-1>=1:
                b.add(j-1)
if 1 in b:
    print("No")
    exit()
print("Yes")
0