結果
問題 |
No.2402 Dirty Stairs and Shoes
|
ユーザー |
|
提出日時 | 2023-10-29 13:12:17 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 608 bytes |
コンパイル時間 | 403 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 17,820 KB |
最終ジャッジ日時 | 2024-09-25 16:41:08 |
合計ジャッジ時間 | 3,678 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | TLE * 1 -- * 31 |
ソースコード
n,k=map(int,input().split()) d=int(input()) if d != 0: d_list=list(map(int,input().split())) else: d_list=[] c=int(input()) if c != 0: c_list=list(map(int,input().split())) else: c_list=[] dp=[False]*(n+1) for i in range(n+1): if i in d_list: dp[i]=False elif i in c_list: dp[i]=True else: if i==0: dp[i]=True elif i<k: dp[i]=dp[i-1] else: if dp[i-1]==True or dp[i-k]==True: dp[i]=True else: dp[i]==False if dp[-1]==True: print("Yes") else: print("No")