結果

問題 No.4 おもりと天秤
ユーザー Shirapon_ponShirapon_pon
提出日時 2021-11-09 12:11:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 437 bytes
コンパイル時間 557 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 59,008 KB
最終ジャッジ日時 2024-04-29 07:49:13
合計ジャッジ時間 2,073 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
51,840 KB
testcase_01 AC 41 ms
52,096 KB
testcase_02 AC 45 ms
51,712 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 41 ms
51,840 KB
testcase_07 WA -
testcase_08 AC 49 ms
59,008 KB
testcase_09 AC 47 ms
58,624 KB
testcase_10 WA -
testcase_11 AC 40 ms
51,712 KB
testcase_12 AC 40 ms
51,712 KB
testcase_13 AC 41 ms
51,968 KB
testcase_14 AC 41 ms
52,096 KB
testcase_15 AC 41 ms
51,840 KB
testcase_16 WA -
testcase_17 AC 40 ms
51,584 KB
testcase_18 AC 47 ms
58,624 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

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

all_pattern = itertools.combinations_with_replacement("rl",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