結果
| 問題 |
No.268 ラッピング(Easy)
|
| コンテスト | |
| ユーザー |
tkmst201
|
| 提出日時 | 2017-05-06 11:44:22 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 924 bytes |
| コンパイル時間 | 1,588 ms |
| コンパイル使用メモリ | 161,720 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-14 13:49:39 |
| 合計ジャッジ時間 | 2,219 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:23:24: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
23 | REP(i, 3) scanf("%d", l + i);
| ~~~~~^~~~~~~~~~~~~
main.cpp:24:24: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
24 | REP(i, 3) scanf("%d", c + i);
| ~~~~~^~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS = 1e-10;
int main() {
int l[3], c[3];
REP(i, 3) scanf("%d", l + i);
REP(i, 3) scanf("%d", c + i);
int ans = INF;
sort(l, l + 3);
sort(c, c + 3);
do {
int ls[3];
REP(i, 3) ls[i] = 2 * (l[i] + l[(i + 1) % 3]);
int now = 0;
REP(i, 3) now += ls[i] * c[i];
chmin(ans, now);
} while (next_permutation(l, l + 3));
cout << ans << endl;
return 0;
}
tkmst201