結果
| 問題 | No.549 素材合成システム |
| コンテスト | |
| ユーザー |
sekiya9311
|
| 提出日時 | 2017-07-28 22:35:10 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 549 bytes |
| 記録 | |
| コンパイル時間 | 2,003 ms |
| コンパイル使用メモリ | 176,112 KB |
| 実行使用メモリ | 39,588 KB |
| 最終ジャッジ日時 | 2024-10-10 05:12:47 |
| 合計ジャッジ時間 | 5,736 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 4 TLE * 1 -- * 39 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 10;
long long n, x[MAX];
int main() {
scanf("%lld", &n);
for (int i = 0; i < n; i++) {
scanf("%lld", x + i);
}
sort(x, x + n);
reverse(x, x + n);
set<long long> se;
se.insert(0);
for (int i = 0; i < n; i++) {
set<long long> se2;
for (long long e : se) {
se2.insert(e + x[i] / 2);
se2.insert(x[i] + e / 2);
}
se = se2;
}
cout << *max_element(se.begin(), se.end()) << endl;
}
sekiya9311