結果
問題 | No.4 おもりと天秤 |
ユーザー |
![]() |
提出日時 | 2020-09-06 00:03:05 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 41 ms / 5,000 ms |
コード長 | 207 bytes |
コンパイル時間 | 168 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 52,224 KB |
最終ジャッジ日時 | 2024-11-29 06:22:25 |
合計ジャッジ時間 | 2,143 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
N = int(input()) W = [int(a) for a in input().split()] su = sum(W) if su & 1: print("impossible") exit() s = 1 << (su // 2) for w in W: s |= s >> w print("possible" if s & 1 else "impossible")