結果
| 問題 |
No.4 おもりと天秤
|
| コンテスト | |
| ユーザー |
goto_isyuku
|
| 提出日時 | 2017-05-28 23:13:00 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 625 bytes |
| コンパイル時間 | 273 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 736,860 KB |
| 最終ジャッジ日時 | 2024-09-21 15:54:27 |
| 合計ジャッジ時間 | 7,206 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 MLE * 1 -- * 20 |
ソースコード
n = input()
wl = [int(x) for x in input().split()]
if sum(wl) % 2 == 1:
print("impossible")
else:
obj_sum = sum(wl) // 2
x = True
tmp = [[[], 0]]
cnt = 0
while x and cnt < len(wl) - 1:
new_tmp = []
for t in tmp:
for i in range(len(wl)):
if i not in t[0]:
new_tmp.append([t[0] + [i], t[1] + wl[i]])
for i in new_tmp:
if i[1] == obj_sum:
x = False
break
cnt += 1
tmp = new_tmp
if x:
print("impossible")
else:
print("possible")
goto_isyuku