結果

問題 No.4 おもりと天秤
ユーザー yaoshimax
提出日時 2015-02-09 07:34:44
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 284 bytes
コンパイル時間 470 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2024-06-23 16:07:37
合計ジャッジ時間 1,357 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

N = int(raw_input())
W = map(int, raw_input().split())
S=0
for w in W:
   S+=w
if S%2 != 0:
   print "impossible"
   exit()
S/=2

W.sort()
W.reverse()
A=0
B=0
for w in W:
   if A< B:
      A+=w
   else:
      B+=w
if A==S:
   print "possible"
else:
   print "impossible"
0