結果

問題 No.4 おもりと天秤
ユーザー convexineq
提出日時 2020-11-22 23:49:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 201 bytes
コンパイル時間 380 ms
コンパイル使用メモリ 82,500 KB
実行使用メモリ 54,564 KB
最終ジャッジ日時 2024-07-23 16:49:32
合計ジャッジ時間 2,192 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline = sys.stdin.readline
read = sys.stdin.read

n,*w = map(int,read().split())
dp = 1
for i in w:
    dp |= 1<<i
print("possible" if sum(w)%2==0 and dp>>(sum(w)//2)&1 else "impossible")
0