結果
問題 | No.268 ラッピング(Easy) |
ユーザー |
![]() |
提出日時 | 2015-08-21 22:48:40 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 910 bytes |
コンパイル時間 | 1,143 ms |
コンパイル使用メモリ | 165,256 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-18 11:48:32 |
合計ジャッジ時間 | 1,645 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#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; }