結果

問題 No.268 ラッピング(Easy)
コンテスト
ユーザー y_mazun
提出日時 2015-08-21 22:28:33
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 523 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 584 ms
コンパイル使用メモリ 74,068 KB
実行使用メモリ 80,468 KB
最終ジャッジ日時 2026-04-02 04:03:36
合計ジャッジ時間 1,180 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <algorithm>
#include <cstdio>
#define REP(i,n) for(int i=0; i<(int)(n); i++)

inline int getInt(){ int s; scanf("%d", &s); return s; }

#include <queue>
#include <set>

using namespace std;

int main(){
  vector<int> l(3);
  vector<int> a(3);

  REP(i,3) l[i] = getInt();
  REP(i,3) a[i] = getInt();

  vector<int> k(3);
  REP(i,3) k[i] = l[0] + l[1] + l[2] - l[i];

  sort(a.begin(), a.end());
  sort(k.rbegin(), k.rend());

  int ans = 0;
  REP(i,3) ans += 2 * a[i] * k[i];
  printf("%d\n", ans);

  return 0;
}
0