結果

問題 No.268 ラッピング(Easy)
ユーザー RIGIHRIGIH
提出日時 2017-07-20 16:06:16
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 633 bytes
コンパイル時間 711 ms
コンパイル使用メモリ 64,172 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 05:53:07
合計ジャッジ時間 1,532 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <stdio.h>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define LL long long
#define mass 1000000007
using namespace std;


int main(){
	
	int l[3];
	int r,b,y;
	cin>>l[0]>>l[1]>>l[2];
	cin>>r>>b>>y;

	int la=l[0]+l[1]+l[2];
	int ans=0;

	rep(i,3){
		rep(j,3){
			if(i!=j){
				if(ans!=0){
					ans=min(ans,r*(la-l[i])*2+b*(la-l[j])*2+y*(l[i]+l[j])*2);
				}else{
					ans=r*(la-l[i])*2+b*(la-l[j])*2+y*(l[i]+l[j])*2;
				}
			}
		}
	}
	cout<<ans<<endl;			


	return 0;
	

}
0