結果
問題 |
No.4 おもりと天秤
|
ユーザー |
![]() |
提出日時 | 2020-02-13 13:56:25 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 432 bytes |
コンパイル時間 | 115 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 17,568 KB |
最終ジャッジ日時 | 2024-10-05 19:30:46 |
合計ジャッジ時間 | 6,798 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 TLE * 1 -- * 17 |
ソースコード
n = int(input()) lst1 = list(map(int,input().split())) #lst1のごうけいのうち、いくつかを使って半分にできるかを考える l1sum = sum(lst1) if l1sum%2 != 0: print("impossible") exit() def func(i,D): if i == n: return D*2 == l1sum if func(i+1,D): return True if func(i+1,D+lst1[i]): return True return False print("possible" if func(0,0) else "impossible")