結果

問題 No.268 ラッピング(Easy)
ユーザー togatogatogatoga
提出日時 2015-08-21 22:48:40
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 910 bytes
コンパイル時間 1,218 ms
コンパイル使用メモリ 149,668 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-25 15:01:07
合計ジャッジ時間 1,950 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

#define mp       make_pair
#define mt	 make_tuple
#define pb       push_back
#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    pair<int,int>      pii;
typedef    pair<long,long>    pll;

const int INF=1<<29;
const double EPS=1e-9;
const int MOD = 100000007;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
vector<int> L;
vector<int> ribon;
int main(){
  L.resize(3);
  ribon.resize(3);
  for (int i = 0; i < 3; i++){
    cin >> L[i];
  }
  for (int i = 0; i < 3; i++){
    cin >> ribon[i];
  }
  sort(L.begin(), L.end());
  int ans = INF;
  do{
    int res = 0;
    res += (2 * L[0] + 2 * L[1]) * ribon[0];
    res += (2 * L[1] + 2 * L[2]) * ribon[1];
    res += (2 * L[0] + 2 * L[2]) * ribon[2];
    ans = min(ans, res);
  }while(next_permutation(L.begin(), L.end()));
  cout << ans << endl;
}
0