結果
| 問題 | No.2402 Dirty Stairs and Shoes |
| コンテスト | |
| ユーザー |
Cecil
|
| 提出日時 | 2023-08-04 22:07:29 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 59 ms / 2,000 ms |
| + 547µs | |
| コード長 | 597 bytes |
| 記録 | |
| コンパイル時間 | 64 ms |
| コンパイル使用メモリ | 82,392 KB |
| 実行使用メモリ | 103,556 KB |
| 最終ジャッジ日時 | 2026-10-05 00:43:24 |
| 合計ジャッジ時間 | 3,277 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
ソースコード
N, K = map(int, input().split())
M1 = int(input())
A = set(map(int, input().split()))
M2 = int(input())
B = set(map(int, input().split()))
dp = [ False ] * (N+1)
dp[0] = True
for i in range(1, N+1):
if i in B:
dp[i] = True
elif i in A:
dp[i] = False
else:
if i < K:
dp[i] = dp[i-1]
if i >= K:
if dp[i-K] == True or dp[i-1] == True:
dp[i] = True
else:
dp[i] = dp[i-1]
#print(A)
#print(B)
#"print(dp)
if dp[N] == True or dp[N-K] == True:
print("Yes")
else:
print("No")
Cecil