結果

問題 No.268 ラッピング(Easy)
ユーザー masamasa
提出日時 2015-08-21 23:03:03
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 557 bytes
コンパイル時間 1,231 ms
コンパイル使用メモリ 68,172 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-25 15:17:31
合計ジャッジ時間 2,038 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0