結果
| 問題 | No.268 ラッピング(Easy) |
| コンテスト | |
| ユーザー |
data9824
|
| 提出日時 | 2015-08-25 06:30:55 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 742 bytes |
| 記録 | |
| コンパイル時間 | 619 ms |
| コンパイル使用メモリ | 58,604 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-18 13:20:15 |
| 合計ジャッジ時間 | 1,081 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
#include <iostream>
#include <limits>
#include <algorithm>
using namespace std;
int main() {
int l[3];
cin >> l[0] >> l[1] >> l[2];
int r, b, y;
cin >> r >> b >> y;
int minLength = std::numeric_limits<int>::max();
for (int heightIndex = 0; heightIndex < 3; ++heightIndex) {
for (int widthIndex = 0; widthIndex < 3; ++widthIndex) {
if (heightIndex == widthIndex) {
continue;
}
int depthIndex = (3 - (heightIndex + widthIndex) % 3) % 3;
int rLength = (l[heightIndex] + l[depthIndex]) * 2 * r;
int bLength = (l[heightIndex] + l[widthIndex]) * 2 * b;
int yLength = (l[widthIndex] + l[depthIndex]) * 2 * y;
minLength = min(minLength, rLength + bLength + yLength);
}
}
cout << minLength << endl;
return 0;
}
data9824