結果
| 問題 | No.4 おもりと天秤 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-12-24 20:10:50 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 441 bytes |
| 記録 | |
| コンパイル時間 | 289 ms |
| コンパイル使用メモリ | 21,284 KB |
| 実行使用メモリ | 15,868 KB |
| 最終ジャッジ日時 | 2026-08-30 13:18:10 |
| 合計ジャッジ時間 | 4,187 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 WA * 3 |
ソースコード
def main():
n = input()
w = list(map(int, input().split()))
s = sum(w)
if s % 2 != 0:
print("impossible")
else:
l = [0 for i in range(s // 2 + 1)]
l[0] = 1
for x in w:
for y in range(len(l)):
if l[y] != 0 and y + x < len(l):
l[y + x] = 1
print("possible" if l[s // 2] else "impossible")
if __name__ == '__main__':
main()