結果
| 問題 | No.4 おもりと天秤 | 
| コンテスト | |
| ユーザー |  Shin09shin | 
| 提出日時 | 2019-01-26 18:22:58 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                MLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 451 bytes | 
| コンパイル時間 | 363 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 818,084 KB | 
| 最終ジャッジ日時 | 2024-09-16 16:14:53 | 
| 合計ジャッジ時間 | 3,701 ms | 
| ジャッジサーバーID (参考情報) | judge6 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 2 MLE * 1 -- * 20 | 
ソースコード
import itertools
n = int(input())
w = list(map(int, input().split()))
x = list(itertools.permutations(w))
c = False
if sum(w) % 2 != 0:
    print('impossible')
else:
    b = sum(w) // 2
    for var in x:
        a = 0
        for i in var:
            a += i
            if a == b:
                c = True
                break
            elif a > b:
                break
    if c:
        print('possible')
    else:
        print('impossible')
            
            
            
        