結果

問題 No.3288 Sloppy Land Grading
ユーザー norioc
提出日時 2025-10-03 22:18:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 475 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 395 ms
コンパイル使用メモリ 82,060 KB
実行使用メモリ 77,624 KB
最終ジャッジ日時 2025-10-03 22:18:17
合計ジャッジ時間 6,994 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    A, B, C, X, Y, Z = map(int, input().split())
    xs = sorted([(A, X), (B, Y), (C, Z)])

    a, x = xs[0]
    b, y = xs[1]
    c, z = xs[2]

    res = (b-a) * y + (c-a) * z
    res = min(res, (b-a) * x + (c-b) * z)
    res = min(res, (c-a) * x + (c-b) * y)

    return res


INF = 1 << 60
T = int(input())
for _ in range(T):
    ans = solve()
    print(ans)
0