結果
問題 | No.549 素材合成システム |
ユーザー |
![]() |
提出日時 | 2018-01-03 21:52:29 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 36 ms / 2,000 ms |
コード長 | 437 bytes |
コンパイル時間 | 1,076 ms |
コンパイル使用メモリ | 73,044 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 02:30:10 |
合計ジャッジ時間 | 3,823 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 44 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <sstream> #include <cmath> #include <stack> #include <cctype> using namespace std; int main() { vector<int> p; int N =0; cin>>N; int tmp=0; for(int i=0; i<N; i++){ cin>>tmp; p.push_back(tmp); } sort(p.begin(),p.end()); int max = p[p.size()-1]; for(int i=0; i<p.size()-1;i++){ max += p[i]/2; } cout<<max<<endl; return 0; }