結果

問題 No.549 素材合成システム
ユーザー kyuna
提出日時 2019-08-20 19:24:45
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 741 ms
コンパイル使用メモリ 74,624 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-06 16:03:11
合計ジャッジ時間 3,178 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 44
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

int main() {
    int n; cin >> n;
    vector<int> x(n);
    for (int &xi: x) cin >> xi;
    sort(x.begin(), x.end());
    int ans = x.back(); x.pop_back();
    for (int xi: x) ans += xi / 2;
    cout << ans << endl;
    return 0;
}
0