結果
| 問題 |
No.268 ラッピング(Easy)
|
| コンテスト | |
| ユーザー |
soupesuteaka
|
| 提出日時 | 2015-08-21 22:45:44 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 842 bytes |
| コンパイル時間 | 510 ms |
| コンパイル使用メモリ | 85,324 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-18 11:47:07 |
| 合計ジャッジ時間 | 986 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <cstdio>
#include <sstream>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <algorithm>
#include <set>
#include <map>
#include <list>
#include <iomanip>
#define INF 1000000001
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (a); i >= (b); i--)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const double PI = acos(-1.0);
int L[3];
int R, B, Y;
int main()
{
ios::sync_with_stdio(false);
FOR(i,0,3) cin >> L[i];
cin >> R >> B >> Y;
int ary[3] = {0,1,2};
int ans=INF;
do {
ans = min(ans, R*2*(L[ary[0]]+L[ary[1]]) + B*2*(L[ary[1]]+L[ary[2]]) + Y*2*(L[ary[2]]+L[ary[0]]) );
} while (next_permutation(ary, ary+3));
cout << ans << endl;
return 0;
}
soupesuteaka