結果

問題 No.1538 引きこもりさんは引き算が得意。
ユーザー noriocnorioc
提出日時 2024-02-08 03:05:11
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 675 bytes
コンパイル時間 823 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 790,672 KB
最終ジャッジ日時 2024-02-08 03:05:25
合計ジャッジ時間 10,957 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
53,460 KB
testcase_01 AC 31 ms
53,460 KB
testcase_02 AC 37 ms
53,460 KB
testcase_03 AC 52 ms
53,460 KB
testcase_04 AC 30 ms
53,460 KB
testcase_05 AC 30 ms
53,460 KB
testcase_06 AC 30 ms
53,460 KB
testcase_07 AC 30 ms
53,460 KB
testcase_08 WA -
testcase_09 AC 32 ms
53,460 KB
testcase_10 AC 32 ms
53,460 KB
testcase_11 AC 30 ms
53,460 KB
testcase_12 WA -
testcase_13 AC 38 ms
53,460 KB
testcase_14 AC 32 ms
53,460 KB
testcase_15 AC 31 ms
53,460 KB
testcase_16 WA -
testcase_17 AC 31 ms
53,460 KB
testcase_18 AC 31 ms
53,460 KB
testcase_19 AC 31 ms
53,460 KB
testcase_20 AC 31 ms
53,460 KB
testcase_21 AC 31 ms
53,460 KB
testcase_22 AC 31 ms
53,456 KB
testcase_23 AC 31 ms
53,460 KB
testcase_24 AC 31 ms
53,460 KB
testcase_25 AC 31 ms
53,460 KB
testcase_26 AC 31 ms
53,460 KB
testcase_27 AC 33 ms
53,460 KB
testcase_28 AC 37 ms
53,460 KB
testcase_29 AC 31 ms
53,460 KB
testcase_30 AC 31 ms
53,460 KB
testcase_31 AC 30 ms
53,460 KB
testcase_32 WA -
testcase_33 AC 31 ms
53,460 KB
testcase_34 AC 31 ms
53,460 KB
testcase_35 AC 31 ms
53,460 KB
testcase_36 AC 31 ms
53,460 KB
testcase_37 AC 317 ms
234,924 KB
testcase_38 AC 476 ms
234,924 KB
testcase_39 AC 259 ms
234,944 KB
testcase_40 AC 258 ms
234,924 KB
testcase_41 AC 301 ms
234,924 KB
testcase_42 AC 261 ms
234,924 KB
testcase_43 AC 32 ms
53,460 KB
testcase_44 AC 204 ms
239,076 KB
testcase_45 AC 372 ms
239,076 KB
testcase_46 AC 32 ms
53,460 KB
testcase_47 MLE -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def subs(a: list) -> set:
    s = set()
    for x in a:
        t = s.copy()
        for y in s:
            t.add(x - y)
            t.add(y - x)
        t.add(x)
        s = t
    return s


N, K = map(int, input().split())
A = list(map(int, input().split()))

if K in A:
    print('Yes')
    exit()


def solve():
    a = A[:N//2]
    b = A[N//2:]

    xs = subs(a)
    ys = subs(b)
    print(f'{a=} {xs=}')
    print(f'{b=} {ys=}')
    if K in xs or K in ys: return True
    for x in xs:
        if x-K in ys or x+K in ys:
            return True
    return False


def solve2():
    xs = subs(A)
    return K in xs


if solve2():
    print('Yes')
else:
    print('No')
0