結果

問題 No.4 おもりと天秤
ユーザー JunOnumaJunOnuma
提出日時 2017-06-14 13:29:20
言語 Python2
(2.7.18)
結果
AC  
実行時間 108 ms / 5,000 ms
コード長 290 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 6,676 KB
実行使用メモリ 6,396 KB
最終ジャッジ日時 2023-09-08 17:30:13
合計ジャッジ時間 2,602 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,984 KB
testcase_01 AC 11 ms
5,948 KB
testcase_02 AC 13 ms
5,876 KB
testcase_03 AC 12 ms
5,936 KB
testcase_04 AC 13 ms
6,008 KB
testcase_05 AC 108 ms
6,348 KB
testcase_06 AC 11 ms
6,012 KB
testcase_07 AC 104 ms
6,256 KB
testcase_08 AC 78 ms
6,308 KB
testcase_09 AC 80 ms
6,384 KB
testcase_10 AC 107 ms
6,220 KB
testcase_11 AC 11 ms
6,016 KB
testcase_12 AC 11 ms
5,936 KB
testcase_13 AC 11 ms
5,984 KB
testcase_14 AC 11 ms
6,048 KB
testcase_15 AC 11 ms
5,980 KB
testcase_16 AC 12 ms
5,988 KB
testcase_17 AC 12 ms
6,012 KB
testcase_18 AC 92 ms
6,224 KB
testcase_19 AC 104 ms
6,312 KB
testcase_20 AC 101 ms
6,356 KB
testcase_21 AC 100 ms
6,352 KB
testcase_22 AC 103 ms
6,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(raw_input())
l = map(int, raw_input().split())
ls = [False for _ in range(100*n+1)]
ls[0] = True
for w in l:
    for i in range(100*n,-1,-1):
        if ls[i]:
            ls[i+w] = True
if sum(l) % 2 == 1 or ls[sum(l)/2] == False:
    print 'impossible'
else:
    print 'possible'
0