結果
問題 | No.2402 Dirty Stairs and Shoes |
ユーザー |
|
提出日時 | 2023-08-04 21:50:52 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 78 ms / 2,000 ms |
コード長 | 406 bytes |
コンパイル時間 | 163 ms |
コンパイル使用メモリ | 82,240 KB |
実行使用メモリ | 95,728 KB |
最終ジャッジ日時 | 2024-12-20 02:38:49 |
合計ジャッジ時間 | 2,883 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 |
ソースコード
n,k=map(int,input().split()) a=int(input()) A=list(map(int,input().split())) b=int(input()) B=list(map(int,input().split())) N=[0]*(n+1) N[0]=2 N[-1]=1 N=N+[-1]*k for i in B: N[i]=2 for i in A: N[i]=-1 for i in reversed(range(n)): if N[i+1]==1 or N[i+k]==1: if N[i]==2: print("Yes") #print(N) exit() if N[i]==0: N[i]=1 print("No")