結果

問題 No.268 ラッピング(Easy)
ユーザー koyumeishi
提出日時 2015-08-21 22:40:15
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 575 bytes
コンパイル時間 751 ms
コンパイル使用メモリ 81,596 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-18 11:46:14
合計ジャッジ時間 1,341 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cstdio>
#include <sstream>
#include <map>
#include <string>
#include <algorithm>
#include <queue>
#include <cmath>
#include <set>
using namespace std;

int main(){
	vector<int> l(3);
	for(int i=0; i<3; i++){
		cin >> l[i];
	}
	vector<int> r(3);
	for(int i=0; i<3; i++){
		cin >> r[i];
	}

	sort(r.begin(), r.end());
	
	vector<int> w(3);
	for(int i=0; i<3; i++){
		w[i] = (l[i]+l[(i+1)%3])*2;
	}
	sort(w.rbegin(), w.rend());

	int ans = 0;
	for(int i=0; i<3; i++){
		ans += r[i] * w[i];
	}

	cout << ans << endl;



	return 0;
}
0