結果

問題 No.4 おもりと天秤
ユーザー syunsuke1024syunsuke1024
提出日時 2020-05-05 17:00:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 262 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 87,204 KB
実行使用メモリ 71,608 KB
最終ジャッジ日時 2023-09-09 04:24:06
合計ジャッジ時間 3,023 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,436 KB
testcase_01 AC 70 ms
71,116 KB
testcase_02 AC 71 ms
71,356 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 71 ms
71,424 KB
testcase_06 AC 71 ms
71,308 KB
testcase_07 AC 71 ms
71,200 KB
testcase_08 AC 73 ms
71,200 KB
testcase_09 AC 76 ms
71,580 KB
testcase_10 AC 73 ms
71,608 KB
testcase_11 AC 74 ms
71,108 KB
testcase_12 AC 73 ms
71,360 KB
testcase_13 AC 72 ms
71,200 KB
testcase_14 AC 72 ms
71,356 KB
testcase_15 AC 71 ms
71,112 KB
testcase_16 WA -
testcase_17 AC 72 ms
71,240 KB
testcase_18 WA -
testcase_19 AC 72 ms
71,196 KB
testcase_20 AC 75 ms
71,324 KB
testcase_21 AC 75 ms
71,360 KB
testcase_22 AC 74 ms
71,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
W=list(map(int,input().split()))
if sum(W)%2==1:
    print("impossible")
    exit()
SUM=1
for i in range(N):
    SUM=SUM | SUM<<W[i]
SUM=str(bin(SUM))
SUM=SUM[::-1]
#print(SUM)
if SUM[N//1]=="1":
    print("possible")
else:
    print("impossible")
0