結果
問題 |
No.4 おもりと天秤
|
ユーザー |
![]() |
提出日時 | 2020-02-13 13:55:45 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 432 bytes |
コンパイル時間 | 317 ms |
コンパイル使用メモリ | 82,204 KB |
実行使用メモリ | 66,964 KB |
最終ジャッジ日時 | 2024-10-05 19:28:00 |
合計ジャッジ時間 | 7,112 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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")