結果

問題 No.1242 高橋君とすごろく
ユーザー tanon710tanon710
提出日時 2020-10-02 23:09:28
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 714 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 82,540 KB
実行使用メモリ 53,840 KB
最終ジャッジ日時 2024-07-17 23:24:22
合計ジャッジ時間 2,022 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 23 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
arr=list(map(int,input().split()))
s=set(arr)
ans=True
for val in arr[::-1]:
    if val-1 in s:
        if val-2==1 or val-3==1 or val-5==1 or val-8==1:
            continue
        else:
            ans=False
    if val-3 in s:
        if val-4==1 or val-7==1:
            continue
        else:
            ans=False
    if val-5 in s:
        if val-7==1 or val-8==1 or val-10==1 or val-13==1:
            continue
        else:
            ans=False
    if val-1 in s and val-2 in s:
        if val-3==1:
            continue
        else:
            ans=False
    if val-1 in s and val-2 in s and val-3 in s:
        ans=False
if ans==True:
    print('Yes')
else:
    print('No')
0