結果
| 問題 | No.3288 Sloppy Land Grading |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-10-04 01:49:05 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 183 ms / 2,000 ms |
| + 919µs | |
| コード長 | 527 bytes |
| 記録 | |
| コンパイル時間 | 992 ms |
| コンパイル使用メモリ | 174,112 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-15 10:46:01 |
| 合計ジャッジ時間 | 4,910 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 16 |
ソースコード
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <iomanip>
#include <numeric>
using namespace std;
using ll = long long;
void solve() {
int N = 3;
vector<ll> A(N), X(N);
for (int i = 0;i < N;i++) cin >> A[i];
for (int i = 0;i < N;i++) cin >> X[i];
ll res = (1LL << 60);
for (int i = 0;i < N;i++) {
ll sc = 0;
for (int j = 0;j < N;j++) sc += X[j] * abs(A[i]-A[j]);
res = min(res, sc);
}
cout << res << endl;
}
int main() {
int t;cin >> t;
while (t--) solve();
}