結果

問題 No.4 おもりと天秤
ユーザー Shirapon_ponShirapon_pon
提出日時 2021-11-09 12:14:59
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 424 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 81,152 KB
最終ジャッジ日時 2024-04-29 07:52:18
合計ジャッジ時間 6,956 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,968 KB
testcase_01 AC 40 ms
51,968 KB
testcase_02 AC 60 ms
66,176 KB
testcase_03 AC 47 ms
59,136 KB
testcase_04 AC 48 ms
59,264 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

n = int(input())
w = [int(x) for x in input().split()]

all_pattern = itertools.product("rl",repeat=n)


for p in all_pattern:
    right = 0
    left = 0
    possibility = "impossible"
    for i in range(n):
        if p[i] == "r":
            right += w[i]
        else:
            left += w[i]
    if right == left:
        possibility = "possible"
        break

print(possibility)
0