結果

問題 No.4 おもりと天秤
ユーザー かいかい
提出日時 2023-06-19 03:00:46
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 355 bytes
コンパイル時間 433 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 81,272 KB
最終ジャッジ日時 2023-09-08 20:45:36
合計ジャッジ時間 7,424 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,188 KB
testcase_01 AC 71 ms
71,400 KB
testcase_02 AC 85 ms
76,728 KB
testcase_03 AC 74 ms
75,148 KB
testcase_04 AC 81 ms
76,180 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
W = list(map(int, input().split()))
W_sum = sum(W)
from itertools import combinations
# from collections import defaultdict
# d = defaultdict(int)
for i in range(1, N+1):
    for j in combinations(W, i):
        j_sum = sum(j)
        if j_sum == W_sum-j_sum:
            print("possible")
            exit()

        
print("impossible")
0