結果

問題 No.549 素材合成システム
ユーザー ant2357
提出日時 2017-08-29 00:38:32
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 54 ms / 2,000 ms
コード長 202 bytes
コンパイル時間 2,313 ms
コンパイル使用メモリ 194,932 KB
最終ジャッジ日時 2025-01-05 02:35:07
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 44
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import"bits/stdc++.h"
      |  ^~~~~~
main.cpp:2:21: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
    2 | using namespace std;main(){int n,i,x[100001];cin>>n;memset(x,100001,sizeof(x));for(i=n;i--;)cin>>x[i];sort(x,x+n,greater<int>());for(i=n-1;i>=1;i--)x[0]+=x[i]/2;cout<<x[0]<<endl;}
      |                     ^~~~

ソースコード

diff #

#import"bits/stdc++.h"
using namespace std;main(){int n,i,x[100001];cin>>n;memset(x,100001,sizeof(x));for(i=n;i--;)cin>>x[i];sort(x,x+n,greater<int>());for(i=n-1;i>=1;i--)x[0]+=x[i]/2;cout<<x[0]<<endl;}
0