結果

問題 No.1987 Sandglass Inconvenience
ユーザー lloyz
提出日時 2022-06-24 22:31:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 575 bytes
コンパイル時間 453 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 52,608 KB
最終ジャッジ日時 2024-11-08 18:27:28
合計ジャッジ時間 2,216 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

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

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