結果

問題 No.4 おもりと天秤
ユーザー かいかい
提出日時 2023-06-19 03:22:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 351 bytes
コンパイル時間 469 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 76,412 KB
最終ジャッジ日時 2023-09-08 21:11:15
合計ジャッジ時間 3,344 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
76,008 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 79 ms
76,052 KB
testcase_04 AC 79 ms
75,940 KB
testcase_05 AC 86 ms
75,984 KB
testcase_06 WA -
testcase_07 AC 87 ms
76,032 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 87 ms
76,012 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 76 ms
75,976 KB
testcase_14 WA -
testcase_15 AC 77 ms
75,944 KB
testcase_16 AC 76 ms
75,972 KB
testcase_17 AC 79 ms
76,028 KB
testcase_18 WA -
testcase_19 AC 89 ms
75,976 KB
testcase_20 AC 91 ms
76,328 KB
testcase_21 AC 90 ms
76,024 KB
testcase_22 AC 84 ms
76,060 KB
権限があれば一括ダウンロードができます

ソースコード

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 j+W[i]<=10000:
            dp[j+W[i]] = True
# for i in range(10001):
#     if dp[i]:
#         print(i-1)
if dp[sum(W)//2+1]:
    print("possible")
else:
    print("impossible")
0