結果

問題 No.1242 高橋君とすごろく
ユーザー uni_pythonuni_python
提出日時 2020-10-03 11:48:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 1,356 bytes
コンパイル時間 503 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 76,084 KB
最終ジャッジ日時 2023-09-27 08:47:43
合計ジャッジ時間 3,776 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,500 KB
testcase_01 AC 66 ms
71,496 KB
testcase_02 AC 65 ms
71,364 KB
testcase_03 AC 64 ms
71,580 KB
testcase_04 AC 63 ms
71,420 KB
testcase_05 AC 63 ms
71,496 KB
testcase_06 AC 64 ms
71,340 KB
testcase_07 AC 65 ms
71,340 KB
testcase_08 AC 64 ms
71,224 KB
testcase_09 AC 64 ms
71,056 KB
testcase_10 AC 69 ms
75,832 KB
testcase_11 AC 69 ms
75,780 KB
testcase_12 AC 69 ms
75,644 KB
testcase_13 AC 67 ms
75,932 KB
testcase_14 AC 66 ms
76,084 KB
testcase_15 AC 68 ms
75,920 KB
testcase_16 AC 67 ms
75,760 KB
testcase_17 AC 70 ms
75,876 KB
testcase_18 AC 68 ms
75,920 KB
testcase_19 AC 69 ms
75,872 KB
testcase_20 AC 67 ms
75,824 KB
testcase_21 AC 69 ms
75,824 KB
testcase_22 AC 68 ms
75,760 KB
testcase_23 AC 69 ms
75,924 KB
testcase_24 AC 69 ms
75,648 KB
testcase_25 AC 67 ms
75,808 KB
testcase_26 AC 67 ms
75,864 KB
testcase_27 AC 64 ms
71,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,K=MI()
    A=LI()
    for i in range(K):
        A[i]-=1
    new=[-1]
    for i in range(K):
        for j in range(i+1,K):
            a=abs(A[i] - A[j])
            temp=-1
            if a==1:# 3,4,新しくできたところより8つ以上下がるとx
                temp=min(A[i],A[j])-3 -8
            elif a==3:# 2,5,新しくできたところより3つ以上下がるとx
                temp=min(A[i],A[j])-2 -3
            elif a==5:# 1,6 新しくできたところより8つ以上下がるとx
                temp=min(A[i],A[j])-1 -8
                
            new.append(temp)
            
    # 小さいところはきちんとやる必要あり
    M=100
    aaa=[0]*(M+6)
    for a in A:
        if a>=M:
            break
        aaa[a]=1
    
    for i in range(M,-1,-1):
        if aaa[i+1] and aaa[i+6]:
            aaa[i]=1
        elif aaa[i+2] and aaa[i+5]:
            aaa[i]=2
        elif aaa[i+3] and aaa[i+4]:
            aaa[i]=3
    if aaa[0]:
        new.append(1)
            
    if max(new)>=1:
        print("No")
    else:
        print("Yes")
            


        
                    
                    


main()
0