結果

問題 No.1242 高橋君とすごろく
ユーザー KudeKude
提出日時 2020-10-02 21:52:11
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 659 bytes
コンパイル時間 1,445 ms
コンパイル使用メモリ 86,696 KB
実行使用メモリ 78,844 KB
最終ジャッジ日時 2023-09-23 04:47:03
合計ジャッジ時間 5,180 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,300 KB
testcase_01 AC 73 ms
71,128 KB
testcase_02 AC 74 ms
71,064 KB
testcase_03 AC 75 ms
71,300 KB
testcase_04 AC 72 ms
71,176 KB
testcase_05 AC 74 ms
71,132 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 74 ms
71,348 KB
testcase_09 AC 73 ms
71,112 KB
testcase_10 AC 79 ms
75,504 KB
testcase_11 AC 82 ms
75,412 KB
testcase_12 AC 79 ms
75,512 KB
testcase_13 AC 82 ms
75,744 KB
testcase_14 AC 79 ms
75,436 KB
testcase_15 AC 82 ms
75,248 KB
testcase_16 AC 79 ms
75,532 KB
testcase_17 AC 79 ms
75,540 KB
testcase_18 AC 80 ms
75,616 KB
testcase_19 AC 81 ms
75,528 KB
testcase_20 RE -
testcase_21 AC 79 ms
75,532 KB
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 AC 80 ms
75,616 KB
testcase_26 RE -
testcase_27 AC 73 ms
71,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
a = list(map(int, input().split()))
d = []
pre = n + 1000
for ai in reversed(a):
    if ai + 100 < pre:
        now = []
        d.append(now)
    now.append(ai-1)
    pre = ai
for di in d:
    mn = di[0]
    mx = di[-1]
    geta = min(mn, 100)
    l = mx - mn + 1 + geta
    dp = [0] * l + [0] * 10
    for ai in di:
        dp[ai - mn + geta] = 1
    for i in range(l - 1, -1, -1):
        if (
            dp[i+1] == dp[i+6] == 1 or
            dp[i+2] == dp[i+5] == 1 or
            dp[i+3] == dp[i+4] == 1
        ):
            dp[i] = 1
    #print(dp)
    if dp[0] == 1:
        print('No')
        exit(0)
print('Yes')
0