結果
問題 |
No.3288 Sloppy Land Grading
|
ユーザー |
|
提出日時 | 2025-10-03 21:29:48 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 65 ms / 2,000 ms |
コード長 | 608 bytes |
コンパイル時間 | 1,644 ms |
コンパイル使用メモリ | 196,020 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-10-03 21:29:52 |
合計ジャッジ時間 | 3,786 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 16 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; template<class T> istream& operator >> (istream& is, vector<T>& vec) { for(T& x : vec) is >> x; return is; } int main() { ios::sync_with_stdio(false); cin.tie(0); int T; cin >> T; while(T--){ vector<ll> a(3), b(3); cin >> a >> b; ll ans = 1ll << 60; for(int i = 0; i < 3; i++){ ll v = 0; for(int j = 0; j < 3; j++){ v += b[j] * abs(a[j] - a[i]); } ans = min(ans, v); } cout << ans << '\n'; } }