結果
問題 | No.268 ラッピング(Easy) |
ユーザー |
|
提出日時 | 2015-08-21 23:03:03 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 557 bytes |
コンパイル時間 | 553 ms |
コンパイル使用メモリ | 66,052 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-18 12:04:10 |
合計ジャッジ時間 | 1,344 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <utility> #include <string> using namespace std; int main() { int l1, l2, l3; int r, b, y; cin >> l1 >> l2 >> l3; cin >> r >> b >> y; vector<int> len; len.push_back(2 * (l1 + l2)); len.push_back(2 * (l2 + l3)); len.push_back(2 * (l3 + l1)); sort(len.begin(), len.end()); int min_len = 1e9; do { min_len = min(min_len, r * len[0] + b * len[1] + y * len[2]); } while (next_permutation(len.begin(), len.end())); cout << min_len << endl; return 0; }