結果

問題 No.268 ラッピング(Easy)
ユーザー imulanimulan
提出日時 2016-02-10 02:40:40
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 621 bytes
コンパイル時間 1,265 ms
コンパイル使用メモリ 162,108 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 20:37:33
合計ジャッジ時間 1,887 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define rep(i,n) for(i=0;i<n;++i)
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); itr++)
#define mp make_pair
#define pb push_back
#define fi first
#define sc second

int main(int argc, char const *argv[]) {
  int i,j;
  int l[3],r,b,y;
  rep(i,3) cin>>l[i];
  cin >>r >>b >>y;

  sort(l,l+3);

  int ans=110101010;
  do{
    int tmp=0;
    tmp+=(2*l[0]+2*l[2])*r;
    tmp+=(2*l[0]+2*l[1])*b;
    tmp+=(2*l[1]+2*l[2])*y;
    ans=min(ans,tmp);
  } while(next_permutation(l,l+3));

  std::cout << ans << std::endl;
  return 0;
}
0