結果
問題 | No.1538 引きこもりさんは引き算が得意。 |
ユーザー | H3PO4 |
提出日時 | 2024-04-14 09:24:17 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 425 bytes |
コンパイル時間 | 177 ms |
コンパイル使用メモリ | 82,296 KB |
実行使用メモリ | 571,736 KB |
最終ジャッジ日時 | 2024-04-14 09:24:30 |
合計ジャッジ時間 | 11,946 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 40 ms
59,952 KB |
testcase_01 | AC | 39 ms
51,992 KB |
testcase_02 | AC | 40 ms
52,712 KB |
testcase_03 | AC | 38 ms
52,888 KB |
testcase_04 | AC | 38 ms
53,152 KB |
testcase_05 | AC | 37 ms
52,216 KB |
testcase_06 | AC | 38 ms
52,544 KB |
testcase_07 | AC | 39 ms
52,096 KB |
testcase_08 | WA | - |
testcase_09 | AC | 37 ms
52,200 KB |
testcase_10 | AC | 39 ms
52,816 KB |
testcase_11 | AC | 37 ms
52,572 KB |
testcase_12 | WA | - |
testcase_13 | AC | 37 ms
52,952 KB |
testcase_14 | AC | 38 ms
52,068 KB |
testcase_15 | AC | 42 ms
54,228 KB |
testcase_16 | WA | - |
testcase_17 | AC | 39 ms
52,792 KB |
testcase_18 | AC | 38 ms
52,500 KB |
testcase_19 | AC | 37 ms
53,560 KB |
testcase_20 | AC | 38 ms
53,500 KB |
testcase_21 | AC | 44 ms
52,136 KB |
testcase_22 | AC | 42 ms
52,128 KB |
testcase_23 | AC | 38 ms
52,336 KB |
testcase_24 | AC | 38 ms
52,356 KB |
testcase_25 | AC | 38 ms
51,884 KB |
testcase_26 | AC | 37 ms
52,892 KB |
testcase_27 | AC | 38 ms
52,376 KB |
testcase_28 | AC | 38 ms
53,420 KB |
testcase_29 | AC | 38 ms
52,332 KB |
testcase_30 | AC | 38 ms
52,892 KB |
testcase_31 | AC | 37 ms
52,684 KB |
testcase_32 | WA | - |
testcase_33 | AC | 38 ms
53,364 KB |
testcase_34 | AC | 38 ms
53,072 KB |
testcase_35 | AC | 37 ms
52,436 KB |
testcase_36 | AC | 39 ms
52,364 KB |
testcase_37 | AC | 763 ms
304,320 KB |
testcase_38 | AC | 785 ms
304,392 KB |
testcase_39 | AC | 442 ms
251,840 KB |
testcase_40 | AC | 693 ms
303,536 KB |
testcase_41 | AC | 723 ms
304,024 KB |
testcase_42 | AC | 660 ms
304,396 KB |
testcase_43 | AC | 43 ms
60,968 KB |
testcase_44 | AC | 400 ms
252,332 KB |
testcase_45 | AC | 967 ms
307,824 KB |
testcase_46 | AC | 39 ms
53,496 KB |
testcase_47 | MLE | - |
testcase_48 | -- | - |
testcase_49 | -- | - |
testcase_50 | -- | - |
testcase_51 | -- | - |
testcase_52 | -- | - |
testcase_53 | -- | - |
testcase_54 | -- | - |
testcase_55 | -- | - |
testcase_56 | -- | - |
ソースコード
def solve(K, A): if K == sum(A) or K == -sum(A): return False st = set() for a in A: new_st = set() new_st.add(a) for x in st: new_st.add(x) new_st.add(a - x) new_st.add(x - a) st = new_st # print(st) return K in st N, K = map(int, input().split()) A = list(map(int, input().split())) print("Yes" if solve(K, A) else "No")