結果

問題 No.1242 高橋君とすごろく
ユーザー wolgnikwolgnik
提出日時 2020-10-02 23:27:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 341 ms / 2,000 ms
コード長 742 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 76,904 KB
最終ジャッジ日時 2023-09-27 08:46:01
合計ジャッジ時間 4,347 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
71,408 KB
testcase_01 AC 62 ms
71,340 KB
testcase_02 AC 68 ms
76,404 KB
testcase_03 AC 62 ms
71,396 KB
testcase_04 AC 62 ms
71,288 KB
testcase_05 AC 70 ms
75,860 KB
testcase_06 AC 63 ms
71,280 KB
testcase_07 AC 65 ms
71,392 KB
testcase_08 AC 63 ms
71,360 KB
testcase_09 AC 64 ms
71,340 KB
testcase_10 AC 294 ms
76,604 KB
testcase_11 AC 80 ms
76,056 KB
testcase_12 AC 299 ms
76,600 KB
testcase_13 AC 79 ms
75,844 KB
testcase_14 AC 296 ms
76,720 KB
testcase_15 AC 82 ms
76,024 KB
testcase_16 AC 82 ms
76,116 KB
testcase_17 AC 69 ms
76,008 KB
testcase_18 AC 66 ms
75,780 KB
testcase_19 AC 72 ms
75,980 KB
testcase_20 AC 83 ms
76,188 KB
testcase_21 AC 70 ms
76,124 KB
testcase_22 AC 85 ms
76,048 KB
testcase_23 AC 83 ms
76,104 KB
testcase_24 AC 83 ms
76,020 KB
testcase_25 AC 79 ms
75,836 KB
testcase_26 AC 341 ms
76,904 KB
testcase_27 AC 66 ms
71,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
N, K = map(int, input().split())
a = set(map(int, input().split()))
for _ in range(200):
  t = set()
  for i in a:
    for j in a:
      if j - i == 1 and (i - 3 > 0): t.add(i - 3)
      if j - i == 3 and (i - 2 > 0): t.add(i - 2)
      if j - i == 5 and (i - 1 > 0): t.add(i - 1)
  if 1 in t:
    print("No")
    exit(0)
  a |= t
for x in a:
  if (x + 1) in a:
    if x - 8 >= 1:
      print("No")
      exit(0)
  if (x + 3) in a:
    if x - 5 >= 1:
      print("No")
      exit(0)
  if (x + 5) in a:
    if x - 9 >= 1:
      print("No")
      exit(0)
for i in a:
  if (i + 1) in a and (i + 2) in a and (i + 3) in a and (i + 4) in a:
    print("No")
    exit(0)
if 1 in a: print("No")
else: print("Yes")
0