結果

問題 No.549 素材合成システム
ユーザー pekempey
提出日時 2017-07-28 22:33:32
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 352 bytes
コンパイル時間 502 ms
コンパイル使用メモリ 68,800 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-10 05:09:37
合計ジャッジ時間 2,063 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 44
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

int main() {
    int n;
    std::cin >> n;

    int ans = 0;
    int max = 0;
    for (int i = 0; i < n; i++) {
        int a;
        scanf("%d", &a);
        ans += a / 2;
        max = std::max(max, a);
    }
    ans += max - max / 2;
    std::cout << ans << std::endl;
}
0