結果
問題 | No.549 素材合成システム |
ユーザー |
|
提出日時 | 2017-08-15 22:11:47 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 35 ms / 2,000 ms |
コード長 | 722 bytes |
コンパイル時間 | 1,473 ms |
コンパイル使用メモリ | 171,324 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 11:03:44 |
合計ジャッジ時間 | 3,738 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 44 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define all(x) (x).begin(),(x).end() #define pb push_back #define fi first #define se second #define dbg(x) cout<<#x" = "<<((x))<<endl template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;} template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;} int f(int a, int b) { return b + a/2; } int main() { int n; cin >>n; vector<int> x(n); rep(i,n) cin >>x[i]; sort(all(x)); rep(i,n-1) x[n-1] = f(x[i],x[n-1]); printf("%d\n", x[n-1]); return 0; }