結果

問題 No.2402 Dirty Stairs and Shoes
ユーザー やでな@競プロやでな@競プロ
提出日時 2023-10-08 21:07:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 734 bytes
コンパイル時間 432 ms
コンパイル使用メモリ 87,324 KB
実行使用メモリ 113,404 KB
最終ジャッジ日時 2023-10-08 21:07:41
合計ジャッジ時間 7,267 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,772 KB
testcase_01 AC 95 ms
71,868 KB
testcase_02 AC 91 ms
71,952 KB
testcase_03 AC 178 ms
97,616 KB
testcase_04 AC 118 ms
78,816 KB
testcase_05 AC 210 ms
113,404 KB
testcase_06 AC 151 ms
90,628 KB
testcase_07 AC 141 ms
82,376 KB
testcase_08 AC 134 ms
84,320 KB
testcase_09 AC 143 ms
93,704 KB
testcase_10 AC 178 ms
96,928 KB
testcase_11 AC 157 ms
90,708 KB
testcase_12 AC 134 ms
81,072 KB
testcase_13 AC 126 ms
95,024 KB
testcase_14 AC 144 ms
106,840 KB
testcase_15 AC 120 ms
94,660 KB
testcase_16 AC 112 ms
83,468 KB
testcase_17 AC 129 ms
99,528 KB
testcase_18 AC 127 ms
92,776 KB
testcase_19 AC 142 ms
102,296 KB
testcase_20 AC 135 ms
99,272 KB
testcase_21 AC 105 ms
77,600 KB
testcase_22 AC 132 ms
88,656 KB
testcase_23 AC 120 ms
87,024 KB
testcase_24 AC 124 ms
87,568 KB
testcase_25 AC 135 ms
102,008 KB
testcase_26 AC 123 ms
88,040 KB
testcase_27 AC 142 ms
104,896 KB
testcase_28 AC 132 ms
95,248 KB
testcase_29 AC 114 ms
88,204 KB
testcase_30 AC 109 ms
77,568 KB
testcase_31 AC 137 ms
105,384 KB
testcase_32 AC 114 ms
88,184 KB
testcase_33 WA -
testcase_34 AC 115 ms
85,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
m1 = int(input())
a = list(map(int,input().split()))
m2 = int(input())
b = list(map(int,input().split()))

from collections import *
da = defaultdict(int)
db = defaultdict(int)
for i in a:
    da[i] += 1
for i in b:
    db[i] += 1

dp = [False]*(n+1)
dp[0] = True

for i in b:
    dp[i] = True

for i in range(0,n):
    if dp[i] == True:
        if da[i] == 0:
            dp[i+1] = True
        if 0 <= i+k <= n:
            if da[i+k] == 0:
                dp[i+k] = True
    elif dp[i] == False:
        if db[i+1] == 1:
            dp[i+1] = True
        if 0 <= i+k <= n:
            if db[i+k] == 1:
                dp[i+k] = True
                
if dp[-1]:
    print("Yes")
else:
    print("No")
0