結果
問題 |
No.268 ラッピング(Easy)
|
ユーザー |
![]() |
提出日時 | 2025-08-07 00:13:14 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 580 bytes |
コンパイル時間 | 3,147 ms |
コンパイル使用メモリ | 278,684 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-08-07 00:13:18 |
合計ジャッジ時間 | 4,151 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); int a, b, c, d, e, f; cin >> a >> b >> c >> d >> e >> f; vector<int> x = { 2 * (a + b), 2 * (b + c), 2 * (c + a) }; vector<int> y = { d, e, f }; vector<int> p = { 0, 1, 2 }; int ans = 1e9; do { int sum = 0; rep(i, 3) sum += x[p[i]] * y[i]; ans = min(ans, sum); } while (next_permutation(p.begin(), p.end())); cout << ans << '\n'; return 0; }