結果
問題 | No.4 おもりと天秤 |
ユーザー |
![]() |
提出日時 | 2024-10-20 13:53:29 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 53 ms / 5,000 ms |
コード長 | 242 bytes |
コンパイル時間 | 384 ms |
コンパイル使用メモリ | 82,276 KB |
実行使用メモリ | 67,268 KB |
最終ジャッジ日時 | 2024-10-20 13:53:42 |
合計ジャッジ時間 | 2,392 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
n=int(input())w=list(map(int,input().split()))W=sum(w)if W%2:print("impossible")exit()q=[0]*(W//2+1)q[0]=1for v in w:for i in reversed(range(W//2)):if i+v<=W//2:q[i+v]|=q[i]print(["impossible","possible"][q[W//2]])