結果
問題 | No.549 素材合成システム |
ユーザー |
|
提出日時 | 2018-02-10 14:31:15 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 32 ms / 2,000 ms |
コード長 | 351 bytes |
コンパイル時間 | 599 ms |
コンパイル使用メモリ | 74,192 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 10:44:39 |
合計ジャッジ時間 | 2,936 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 44 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n; cin >> n; vector<int> x(n, 0); for (int i = 0; i < n; i++) { cin >> x[i]; } sort(x.begin(), x.end()); reverse(x.begin(), x.end()); int exp = x[0]; for (int i = 1; i < n; i++) { exp += x[i] / 2; } cout << exp << endl; return 0; }