結果
問題 | No.549 素材合成システム |
ユーザー |
|
提出日時 | 2019-01-23 14:41:47 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 17 ms / 2,000 ms |
コード長 | 358 bytes |
コンパイル時間 | 1,431 ms |
コンパイル使用メモリ | 170,636 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-16 04:23:15 |
合計ジャッジ時間 | 3,587 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 44 |
ソースコード
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a.begin(), a.end()); int ans = a.back(); for (int i = 0; i < n - 1; i++) { ans += a[i] / 2; } cout << ans << endl; return 0; }