結果
問題 | No.4 おもりと天秤 |
ユーザー |
![]() |
提出日時 | 2024-11-11 21:32:56 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 371 bytes |
コンパイル時間 | 993 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 15,744 KB |
最終ジャッジ日時 | 2024-11-11 21:33:04 |
合計ジャッジ時間 | 8,387 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 TLE * 1 -- * 17 |
ソースコード
import itertools n = int(input()) weight_list = sorted(list(map(int, input().split()))) ans = False weight_sum = sum(weight_list) for bit in range(1 << n): we = 0 for i in range(n): mask = 1 << i if bit & mask: we += weight_list[i] if we == weight_sum - we: ans = True break # output if ans: print('possible') else: print('impossible')