結果

問題 No.2402 Dirty Stairs and Shoes
ユーザー ntudantuda
提出日時 2023-08-05 09:32:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 108,612 KB
最終ジャッジ日時 2023-08-23 01:45:38
合計ジャッジ時間 4,739 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,316 KB
testcase_01 AC 76 ms
71,320 KB
testcase_02 AC 72 ms
70,988 KB
testcase_03 AC 112 ms
103,676 KB
testcase_04 AC 82 ms
76,676 KB
testcase_05 AC 128 ms
108,612 KB
testcase_06 AC 94 ms
84,704 KB
testcase_07 AC 84 ms
77,668 KB
testcase_08 AC 85 ms
78,260 KB
testcase_09 AC 94 ms
87,180 KB
testcase_10 AC 107 ms
95,252 KB
testcase_11 AC 93 ms
87,216 KB
testcase_12 AC 85 ms
79,000 KB
testcase_13 AC 83 ms
77,220 KB
testcase_14 AC 83 ms
77,780 KB
testcase_15 AC 83 ms
77,060 KB
testcase_16 AC 79 ms
76,764 KB
testcase_17 AC 85 ms
77,280 KB
testcase_18 AC 81 ms
77,152 KB
testcase_19 AC 85 ms
77,476 KB
testcase_20 AC 85 ms
76,992 KB
testcase_21 AC 77 ms
76,076 KB
testcase_22 AC 82 ms
77,128 KB
testcase_23 AC 82 ms
76,548 KB
testcase_24 AC 80 ms
77,044 KB
testcase_25 AC 85 ms
77,508 KB
testcase_26 AC 80 ms
76,608 KB
testcase_27 AC 85 ms
77,436 KB
testcase_28 AC 84 ms
77,456 KB
testcase_29 AC 82 ms
76,620 KB
testcase_30 AC 80 ms
76,148 KB
testcase_31 AC 87 ms
77,600 KB
testcase_32 AC 80 ms
76,592 KB
testcase_33 AC 72 ms
71,300 KB
testcase_34 AC 83 ms
76,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
M1 = int(input())
A = set(map(int,input().split()))
M = int(input())
B = set(map(int,input().split()))
C = A | B
dp = [True] * (N+1)
for a in A:
    dp[a] = False
for i in range(1,N+1):
    if i in C:
        continue
    dp[i] = dp[i-1]
    if i >= K:
        dp[i] |= dp[i-K]
if dp[N]:
    print("Yes")
else:
    print("No")
0