結果

問題 No.1242 高橋君とすごろく
ユーザー raven7959raven7959
提出日時 2021-09-30 08:58:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 404 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 75,848 KB
最終ジャッジ日時 2023-09-24 11:08:28
合計ジャッジ時間 4,099 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,184 KB
testcase_01 AC 73 ms
71,476 KB
testcase_02 AC 75 ms
71,260 KB
testcase_03 AC 74 ms
71,060 KB
testcase_04 AC 73 ms
71,388 KB
testcase_05 AC 75 ms
71,396 KB
testcase_06 AC 74 ms
71,012 KB
testcase_07 AC 73 ms
71,360 KB
testcase_08 AC 72 ms
71,428 KB
testcase_09 AC 74 ms
71,056 KB
testcase_10 AC 77 ms
75,696 KB
testcase_11 AC 78 ms
75,796 KB
testcase_12 AC 79 ms
75,748 KB
testcase_13 AC 78 ms
75,624 KB
testcase_14 AC 79 ms
75,536 KB
testcase_15 AC 76 ms
75,676 KB
testcase_16 AC 78 ms
75,596 KB
testcase_17 AC 73 ms
71,056 KB
testcase_18 AC 72 ms
71,020 KB
testcase_19 AC 71 ms
71,436 KB
testcase_20 AC 76 ms
75,592 KB
testcase_21 AC 73 ms
71,412 KB
testcase_22 AC 78 ms
75,728 KB
testcase_23 AC 79 ms
75,588 KB
testcase_24 AC 79 ms
75,848 KB
testcase_25 AC 79 ms
75,700 KB
testcase_26 AC 79 ms
75,604 KB
testcase_27 AC 72 ms
71,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
A=list(map(int,input().split()))
L=[]
for i in range(K):
  for j in range(i+1,K):
    if A[j]-A[i]==1:
      if not A[j] in (3,4,6,9):
        print("No")
        exit()
    elif A[j]-A[i]==3:
      if not A[j] in (2,3,5,8,10):
        print("No")
        exit()
    elif A[j]-A[i]==5:
      if not A[j] in (2,3,4,5,8,9,11,14):
        print("No")
        exit()
print("Yes")
0