結果

問題 No.1242 高橋君とすごろく
ユーザー AEnAEn
提出日時 2022-12-03 15:58:21
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 420 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 61,056 KB
最終ジャッジ日時 2024-04-19 01:39:29
合計ジャッジ時間 2,794 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
52,352 KB
testcase_01 AC 39 ms
52,352 KB
testcase_02 AC 38 ms
51,840 KB
testcase_03 AC 39 ms
52,096 KB
testcase_04 AC 38 ms
52,352 KB
testcase_05 AC 38 ms
51,968 KB
testcase_06 AC 39 ms
52,096 KB
testcase_07 AC 38 ms
51,968 KB
testcase_08 AC 39 ms
51,968 KB
testcase_09 AC 38 ms
52,096 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 39 ms
52,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
A = set(list(map(int, input().split())))

dp = [False]*(N+1)
dp[-1] = True
for i in range(N-1,0,-1):
    if i in A:continue
    cnt = 0
    if dp[i+1] or dp[min(N,i+6)]:
        cnt += 1
    if dp[min(N,i+2)] or dp[min(N,i+5)]:
        cnt += 1
    if dp[min(N,i+3)] or dp[min(N,i+4)]:
        cnt += 1
    if cnt==3:
        dp[i] = True
if dp[1]:
    print('Yes')
else:
    print('No')
0