結果

問題 No.1538 引きこもりさんは引き算が得意。
ユーザー shakayamishakayami
提出日時 2021-11-11 21:00:24
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 407 bytes
コンパイル時間 1,963 ms
コンパイル使用メモリ 86,500 KB
実行使用メモリ 786,756 KB
最終ジャッジ日時 2023-08-15 11:20:53
合計ジャッジ時間 8,781 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,208 KB
testcase_01 AC 71 ms
71,420 KB
testcase_02 AC 72 ms
71,252 KB
testcase_03 AC 75 ms
71,220 KB
testcase_04 AC 71 ms
71,212 KB
testcase_05 AC 73 ms
70,888 KB
testcase_06 AC 72 ms
71,208 KB
testcase_07 AC 72 ms
71,320 KB
testcase_08 AC 72 ms
71,328 KB
testcase_09 AC 71 ms
71,212 KB
testcase_10 AC 79 ms
76,132 KB
testcase_11 AC 71 ms
71,456 KB
testcase_12 AC 72 ms
71,460 KB
testcase_13 AC 76 ms
75,988 KB
testcase_14 AC 96 ms
76,632 KB
testcase_15 AC 77 ms
76,224 KB
testcase_16 AC 73 ms
71,360 KB
testcase_17 AC 72 ms
71,140 KB
testcase_18 AC 71 ms
71,192 KB
testcase_19 AC 72 ms
71,372 KB
testcase_20 AC 73 ms
71,400 KB
testcase_21 AC 72 ms
71,288 KB
testcase_22 AC 73 ms
71,192 KB
testcase_23 AC 71 ms
71,260 KB
testcase_24 AC 71 ms
71,484 KB
testcase_25 AC 71 ms
71,404 KB
testcase_26 AC 72 ms
70,972 KB
testcase_27 AC 72 ms
71,428 KB
testcase_28 AC 72 ms
70,976 KB
testcase_29 AC 70 ms
71,340 KB
testcase_30 AC 71 ms
71,404 KB
testcase_31 AC 73 ms
71,460 KB
testcase_32 AC 70 ms
71,224 KB
testcase_33 AC 72 ms
71,320 KB
testcase_34 AC 72 ms
71,396 KB
testcase_35 AC 72 ms
71,492 KB
testcase_36 AC 69 ms
70,976 KB
testcase_37 MLE -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
A=[int(i) for i in input().split()]
dp=[set() for i in range(1<<N)]
for i in range(N):
    dp[1<<i].add(A[i])
for S in range(1<<N):
    for i in range(N):
        if (S>>i)&1==0:
            for x in dp[S]:
                dp[S|(1<<i)].add(x-A[i])
                dp[S|(1<<i)].add(A[i]-x)
for S in range(1<<N):
    if K in dp[S]:
        print("Yes")
        exit()
print("No")
0