結果
問題 | No.268 ラッピング(Easy) |
ユーザー |
|
提出日時 | 2022-09-29 22:29:05 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 527 bytes |
コンパイル時間 | 2,019 ms |
コンパイル使用メモリ | 195,976 KB |
最終ジャッジ日時 | 2025-02-07 18:28:20 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <bits/stdc++.h>#define rep(i,n) for(int i = 0; i < (n); i++)using namespace std;typedef long long ll;int main(){cin.tie(0);ios::sync_with_stdio(0);int L[3]; rep(i,3) cin >> L[i];int R,B,Y; cin >> R >> B >> Y;sort(L, L + 3);int ans = 1e9;do {int cur = 0;cur += R * 2 * (L[0] + L[1]);cur += B * 2 * (L[1] + L[2]);cur += Y * 2 * (L[2] + L[0]);ans = min(ans, cur);} while(next_permutation(L, L + 3));cout << ans << endl;}