結果

問題 No.4 おもりと天秤
ユーザー かいかい
提出日時 2023-06-19 03:13:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 307 bytes
コンパイル時間 364 ms
コンパイル使用メモリ 86,876 KB
実行使用メモリ 76,224 KB
最終ジャッジ日時 2023-09-08 20:59:36
合計ジャッジ時間 3,479 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
75,732 KB
testcase_01 AC 78 ms
75,692 KB
testcase_02 AC 86 ms
75,664 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 82 ms
75,556 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 75 ms
75,852 KB
testcase_12 AC 74 ms
75,644 KB
testcase_13 AC 74 ms
75,832 KB
testcase_14 AC 73 ms
76,004 KB
testcase_15 AC 74 ms
75,864 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 80 ms
75,924 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
W = list(map(int, input().split()))

dp = [False for _ in range(100*100+1)]
dp[0] = True
for i in range(N):
    for j in range(10001):
        if dp[j] and dp[j]+W[i]<=10000:
            dp[dp[j]+W[i]] = True
# print(dp)
if dp[sum(W)//2]:
    print("possible")
else:
    print("impossible")
0