結果

問題 No.1242 高橋君とすごろく
ユーザー tktk_snsntktk_snsn
提出日時 2021-09-20 17:44:23
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
RE  
実行時間 -
コード長 494 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 10,752 KB
実行使用メモリ 7,960 KB
最終ジャッジ日時 2023-09-15 12:33:44
合計ジャッジ時間 1,588 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,876 KB
testcase_01 AC 16 ms
7,836 KB
testcase_02 AC 15 ms
7,816 KB
testcase_03 AC 16 ms
7,932 KB
testcase_04 AC 16 ms
7,836 KB
testcase_05 AC 16 ms
7,816 KB
testcase_06 AC 16 ms
7,820 KB
testcase_07 AC 16 ms
7,736 KB
testcase_08 AC 15 ms
7,940 KB
testcase_09 AC 16 ms
7,924 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 AC 16 ms
7,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = list(map(int, input().split()))
U = 10 ** 5

B = []
C = []
for a in A:
    if a < U:
        B.append(a)
    elif a > U - 100:
        C.append(a)

ans = "Yes"
dp = [0] * (N + 10)
for a in B:
    dp[a] = 1
for i in reversed(range(N)):
    dp[i] |= (dp[i+1] & dp[i+6])
    dp[i] |= (dp[i+2] & dp[i+5])
    dp[i] |= (dp[i+3] & dp[i+4])
if dp[1]:
    ans = "No"

for x in C:
    for y in C:
        if abs(x - y) in [1, 3, 5]:
            ans = "No"
print(ans)
0