結果

問題 No.4 おもりと天秤
ユーザー popketle
提出日時 2019-12-24 11:36:39
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 250 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 17,692 KB
最終ジャッジ日時 2024-09-21 18:52:41
合計ジャッジ時間 6,842 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 3 TLE * 1 -- * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
W=list(map(int,input().split()))

half=sum(W)/n
for i in range(2**n):
  total=0
  for j in range(n):
    if i>>j&1:
      total+=W[j]
    if total>half:
      break
  if total==half:
    print('possible')
    exit()
print('impossible')
0