結果
| 問題 |
No.549 素材合成システム
|
| ユーザー |
|
| 提出日時 | 2017-07-28 22:31:46 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 19 ms / 2,000 ms |
| コード長 | 317 bytes |
| コンパイル時間 | 1,402 ms |
| コンパイル使用メモリ | 160,372 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-10 05:07:42 |
| 合計ジャッジ時間 | 3,233 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 44 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%d",&n);
| ~~~~~^~~~~~~~~
main.cpp:12:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%d",&x[i]);
| ~~~~~^~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int n;
int x[100001];
int main(void){
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d",&x[i]);
}
sort(x,x+n);
for(int i=0;i<n-1;i++){
x[n-1]+=x[i]/2;
}
printf("%d\n",x[n-1]);
return 0;
}