結果
| 問題 | No.2402 Dirty Stairs and Shoes |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-08-16 22:53:34 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 86 ms / 2,000 ms |
| + 427µs | |
| コード長 | 341 bytes |
| 記録 | |
| コンパイル時間 | 250 ms |
| コンパイル使用メモリ | 95,972 KB |
| 実行使用メモリ | 102,144 KB |
| 最終ジャッジ日時 | 2026-08-25 02:01:47 |
| 合計ジャッジ時間 | 5,274 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
ソースコード
N, K = map(int, input().split())
M = int(input())
A = list(map(int, input().split()))
M = int(input())
B = list(map(int, input().split()))
dp = [True] + [None] * N
for a in A: dp[a] = False
for b in B: dp[b] = True
for i in range(1, N + 1):
if dp[i] is None:
dp[i] = dp[i - 1] or i >= K and dp[i - K]
print("Yes" if dp[N] else "No")