結果
| 問題 |
No.2402 Dirty Stairs and Shoes
|
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2023-08-05 09:32:18 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 100 ms / 2,000 ms |
| コード長 | 358 bytes |
| コンパイル時間 | 404 ms |
| コンパイル使用メモリ | 82,376 KB |
| 実行使用メモリ | 105,316 KB |
| 最終ジャッジ日時 | 2024-12-20 02:48:06 |
| 合計ジャッジ時間 | 3,070 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
ソースコード
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")
ntuda