結果

問題 No.4 おもりと天秤
ユーザー jamadjamad
提出日時 2017-08-13 06:09:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 265 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-04-21 08:50:45
合計ジャッジ時間 2,205 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,624 KB
testcase_01 WA -
testcase_02 AC 27 ms
10,752 KB
testcase_03 AC 28 ms
10,752 KB
testcase_04 AC 29 ms
10,880 KB
testcase_05 AC 115 ms
11,756 KB
testcase_06 AC 29 ms
10,752 KB
testcase_07 AC 113 ms
11,748 KB
testcase_08 WA -
testcase_09 AC 30 ms
10,752 KB
testcase_10 AC 130 ms
12,288 KB
testcase_11 AC 30 ms
10,752 KB
testcase_12 AC 28 ms
10,752 KB
testcase_13 AC 28 ms
10,624 KB
testcase_14 AC 27 ms
10,752 KB
testcase_15 AC 27 ms
10,624 KB
testcase_16 AC 30 ms
10,752 KB
testcase_17 AC 28 ms
10,624 KB
testcase_18 AC 66 ms
11,136 KB
testcase_19 AC 101 ms
11,620 KB
testcase_20 AC 94 ms
11,616 KB
testcase_21 AC 91 ms
11,628 KB
testcase_22 AC 95 ms
11,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
W=sorted(map(int,input().split()))
R={}
for x in W:
    S={}
    for k,v in R.items():
        S[R[k]+x]=R[k]+x
    R[x]=x
    R.update(S)

for k,v in R.items():
    if R[k]==sum(W)//2:
        print('possible')
        break
else:print('impossible')
0