結果

問題 No.3288 Sloppy Land Grading
ユーザー snrnsidy
提出日時 2025-10-03 21:26:48
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 647 bytes
コンパイル時間 706 ms
コンパイル使用メモリ 94,424 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-03 21:27:00
合計ジャッジ時間 2,785 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <unordered_set>
#include <cstring>
#include <queue>
#include <bitset>
#include <map>
#include <stack>

using namespace std;

int main() 
{
	cin.tie(0);
    ios::sync_with_stdio(false);

	long long int a,b,c,x,y,z;
	int tc;

	cin >> tc;

	while(tc--)
	{
		cin >> a >> b >> c >> x >> y >> z;
		long long int res = 2e18;
		long long int cost = abs(a-b)*y + abs(a-c)*z;
		res = min(cost,res);
		cost = abs(a-b)*x + abs(b-c)*z;
		res = min(cost,res);
		cost = abs(a-c)*x + abs(b-c)*y;
		res = min(cost,res);		
		cout << res << '\n';
	}
    return 0;
}
0