結果
| 問題 |
No.3288 Sloppy Land Grading
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-04 22:47:23 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 330 ms / 2,000 ms |
| コード長 | 714 bytes |
| コンパイル時間 | 1,783 ms |
| コンパイル使用メモリ | 194,356 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-11-04 22:47:31 |
| 合計ジャッジ時間 | 7,677 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 16 |
ソースコード
#include <bits/stdc++.h>
long long a, b, c, x, y, z;
int t;
long long calc(long long v) {
return abs(v - a) * x + abs(v - b) * y + abs(v - c) * z;
}
long long solve() {
if (a > b) {
std::swap(a, b);
std::swap(x, y);
}
if (b > c) {
std::swap(b, c);
std::swap(y, z);
}
if (a > b) {
std::swap(a, b);
std::swap(x, y);
}
long long site = b;
if (x + y < z) {
site = c;
}
if (y + z < x) {
site = a;
}
return site;
}
int main() {
std::cin >> t;
for (int i = 1; i <= t; i++) {
std::cin >> a >> b >> c >> x >> y >> z;
std::cout << calc(solve()) << std::endl;
}
return 0;
}