結果

問題 No.4 おもりと天秤
ユーザー 藤川倫生
提出日時 2025-09-26 12:07:53
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 336 bytes
コンパイル時間 3,518 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 18,080 KB
最終ジャッジ日時 2025-09-26 12:08:11
合計ジャッジ時間 9,322 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 TLE * 1 -- * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations
import sys

n = int(input())
w = list(map(int, input().split()))

w_sum = sum(w)
if w_sum % 2 == 0:
    for i in range(1, n + 1):
        cmb = combinations(w, i)
        for c in cmb:
            if sum(c) == w_sum / 2:
                print("possible")
                sys.exit()
print("impossible")
0