結果
問題 | No.268 ラッピング(Easy) |
ユーザー | soupesuteaka |
提出日時 | 2015-08-21 22:45:44 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 842 bytes |
コンパイル時間 | 683 ms |
コンパイル使用メモリ | 83,024 KB |
実行使用メモリ | 4,380 KB |
最終ジャッジ日時 | 2023-09-25 14:59:17 |
合計ジャッジ時間 | 1,357 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,380 KB |
testcase_01 | AC | 1 ms
4,376 KB |
testcase_02 | AC | 2 ms
4,380 KB |
testcase_03 | AC | 1 ms
4,380 KB |
testcase_04 | AC | 1 ms
4,380 KB |
testcase_05 | AC | 2 ms
4,380 KB |
testcase_06 | AC | 2 ms
4,376 KB |
testcase_07 | AC | 2 ms
4,376 KB |
testcase_08 | AC | 2 ms
4,380 KB |
testcase_09 | AC | 2 ms
4,376 KB |
testcase_10 | AC | 2 ms
4,380 KB |
testcase_11 | AC | 2 ms
4,376 KB |
testcase_12 | AC | 2 ms
4,380 KB |
ソースコード
#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; }