結果

問題 No.1242 高橋君とすごろく
ユーザー NatsubiSoganNatsubiSogan
提出日時 2020-12-06 12:14:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 188 ms / 2,000 ms
コード長 398 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 11,844 KB
実行使用メモリ 10,140 KB
最終ジャッジ日時 2023-10-17 13:12:39
合計ジャッジ時間 4,500 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,128 KB
testcase_01 AC 29 ms
10,128 KB
testcase_02 AC 30 ms
10,128 KB
testcase_03 AC 29 ms
10,128 KB
testcase_04 AC 29 ms
10,128 KB
testcase_05 AC 29 ms
10,128 KB
testcase_06 AC 29 ms
10,128 KB
testcase_07 AC 28 ms
10,128 KB
testcase_08 AC 29 ms
10,128 KB
testcase_09 AC 29 ms
10,128 KB
testcase_10 AC 112 ms
10,140 KB
testcase_11 AC 171 ms
10,140 KB
testcase_12 AC 113 ms
10,140 KB
testcase_13 AC 166 ms
10,140 KB
testcase_14 AC 70 ms
10,140 KB
testcase_15 AC 168 ms
10,140 KB
testcase_16 AC 169 ms
10,140 KB
testcase_17 AC 175 ms
10,140 KB
testcase_18 AC 173 ms
10,140 KB
testcase_19 AC 178 ms
10,140 KB
testcase_20 AC 170 ms
10,140 KB
testcase_21 AC 171 ms
10,140 KB
testcase_22 AC 52 ms
10,136 KB
testcase_23 AC 51 ms
10,136 KB
testcase_24 AC 182 ms
10,140 KB
testcase_25 AC 188 ms
10,140 KB
testcase_26 AC 29 ms
10,140 KB
testcase_27 AC 29 ms
10,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
a = list(map(int, input().split()))
s = set(a)
for i in range(k)[::-1]:
    for j in range(a[i], a[i] - 1001, -1):
        if j < 1:continue
        if (j + 1 in s and j + 6 in s) or (j + 2 in s and j + 5 in s) or (j + 3 in s and j + 4 in s):s.add(j)
        if 1 in s:exit(print("No"))
        if all(i in s for i in range(j, j + 7)):exit(print("No"))
print("Yes")
0