結果

問題 No.4 おもりと天秤
ユーザー tkr182tkr182
提出日時 2020-01-31 21:50:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 475 ms / 5,000 ms
コード長 193 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 11,772 KB
実行使用メモリ 42,372 KB
最終ジャッジ日時 2023-10-17 09:23:58
合計ジャッジ時間 15,832 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 455 ms
42,372 KB
testcase_01 AC 455 ms
42,372 KB
testcase_02 AC 457 ms
42,372 KB
testcase_03 AC 457 ms
42,372 KB
testcase_04 AC 460 ms
42,372 KB
testcase_05 AC 462 ms
42,372 KB
testcase_06 AC 461 ms
42,372 KB
testcase_07 AC 463 ms
42,372 KB
testcase_08 AC 463 ms
42,372 KB
testcase_09 AC 464 ms
42,372 KB
testcase_10 AC 464 ms
42,372 KB
testcase_11 AC 465 ms
42,372 KB
testcase_12 AC 458 ms
42,372 KB
testcase_13 AC 463 ms
42,372 KB
testcase_14 AC 468 ms
42,372 KB
testcase_15 AC 473 ms
42,372 KB
testcase_16 AC 475 ms
42,372 KB
testcase_17 AC 460 ms
42,372 KB
testcase_18 AC 459 ms
42,372 KB
testcase_19 AC 463 ms
42,372 KB
testcase_20 AC 461 ms
42,372 KB
testcase_21 AC 460 ms
42,372 KB
testcase_22 AC 462 ms
42,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
n=int(input())
w=list(map(int,input().split()))
s=np.zeros((sum(w)+1))
s[0]=1
for i in w:
    s[i:]+=s[:-i]
print("possible"if (sum(w)-1)%2 and s[sum(w)//2] else"impossible")
0