結果
| 問題 | No.4 おもりと天秤 |
| コンテスト | |
| ユーザー |
yaoshimax
|
| 提出日時 | 2015-02-09 07:34:44 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 284 bytes |
| 記録 | |
| コンパイル時間 | 135 ms |
| コンパイル使用メモリ | 77,464 KB |
| 最終ジャッジ日時 | 2025-12-03 13:36:27 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 WA * 4 |
ソースコード
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"
yaoshimax