結果
問題 |
No.3288 Sloppy Land Grading
|
ユーザー |
|
提出日時 | 2025-10-03 23:57:42 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 755 bytes |
コンパイル時間 | 1,438 ms |
コンパイル使用メモリ | 169,296 KB |
実行使用メモリ | 7,720 KB |
最終ジャッジ日時 | 2025-10-03 23:57:48 |
合計ジャッジ時間 | 5,229 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 1 WA * 15 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> P; #define REP(i,n) for(ll i=0;i<ll(n);i++) int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); ll i,j; int T; cin >> T; while(T--){ ll A,B,C,x,y,z; cin >> A >> B >> C >> x >> y >> z; vector<P> v; v.push_back(P(A,x)); v.push_back(P(B,y)); v.push_back(P(C,z)); sort(v.begin(),v.end()); A=v[0].first; B=v[1].first; C=v[2].first; x=v[0].second; y=v[1].second; z=v[2].second; ll s; if(x-y-z>=0) s=(x-y-z)*A-x*A+y*B+z*C; else s=(x-y-z)*B-x*A+y*B+z*C; ll t; if(x+y-z>=0) t=(x+y-z)*B-x*A-y*B+z*C; else t=(x-y+z)*C-x*A-y*B+z*C; cout << min(s,t) << endl; } return 0; }