結果

問題 No.1987 Sandglass Inconvenience
ユーザー lloyz
提出日時 2022-06-24 22:26:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 489 bytes
コンパイル時間 328 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 76,800 KB
最終ジャッジ日時 2024-11-08 18:21:20
合計ジャッジ時間 4,297 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product

L = list(map(int, input().split()))
x = int(input())

for P in product(range(3), repeat=6):
    LL = []
    for i in range(6):
        LL.append(L[P[i]])
    for bit in range(3**6):
        Q = []
        bitc = bit
        for i in range(6):
            Q.append(bitc % 3 - 1)
            bitc //= 3
        res = 0
        for i in range(6):
            res += Q[i] * LL[i]
        if abs(res) == x:
            print("Yes")
            exit()
print("No")
0