結果
問題 | No.2402 Dirty Stairs and Shoes |
ユーザー |
![]() |
提出日時 | 2023-08-04 21:31:07 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 161 ms / 2,000 ms |
コード長 | 287 bytes |
コンパイル時間 | 339 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 26,500 KB |
最終ジャッジ日時 | 2024-12-20 02:26:40 |
合計ジャッジ時間 | 3,662 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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 = [True]+[False]*nfor i in range(1,n+1):if i in b or i not in a and (dp[i-1] or i>=k and dp[i-k]): dp[i] = Trueprint("Yes" if dp[n] else "No")