結果

問題 No.549 素材合成システム
ユーザー iqueue02
提出日時 2019-10-29 22:59:21
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 380 bytes
コンパイル時間 1,780 ms
コンパイル使用メモリ 170,576 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-14 21:38:37
合計ジャッジ時間 4,452 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 44
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;

int main(){
  int n;
  cin >> n;
  vector<int> x(n);
  rep(i,n) cin >> x[i];
  sort(x.begin(), x.end());
  int res = 0;
  rep(i,n-1) {
    res += x[i] / 2;
  }
  res += x[n-1];
  cout << res << endl;
  return 0;
}
0