結果
| 問題 | No.4 おもりと天秤 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-07-31 19:42:23 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 480 bytes |
| 記録 | |
| コンパイル時間 | 583 ms |
| コンパイル使用メモリ | 20,696 KB |
| 実行使用メモリ | 15,356 KB |
| 最終ジャッジ日時 | 2026-04-27 05:21:58 |
| 合計ジャッジ時間 | 4,167 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 WA * 1 |
ソースコード
n = int(input())
A = [int(i)for i in input().split()]
def solve(n,A):
s = sum(A)
B = set([0])
h = s//2
if s&1:
return False
else:
for i in A:
nB = set(B)
for j in B:
ij = i + j
if ij == h//2:
return True
if ij < h:
nB.add(ij)
B = nB
return False
if solve(n,A):
print("possible")
else:
print("impossible")