結果

問題 No.549 素材合成システム
ユーザー htensaihtensai
提出日時 2019-12-10 09:40:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 670 ms / 2,000 ms
コード長 480 bytes
コンパイル時間 3,096 ms
コンパイル使用メモリ 73,036 KB
実行使用メモリ 67,288 KB
最終ジャッジ日時 2023-09-06 03:04:23
合計ジャッジ時間 24,363 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
56,040 KB
testcase_01 AC 123 ms
55,692 KB
testcase_02 AC 123 ms
55,888 KB
testcase_03 AC 123 ms
55,848 KB
testcase_04 AC 121 ms
56,012 KB
testcase_05 AC 122 ms
56,120 KB
testcase_06 AC 119 ms
55,584 KB
testcase_07 AC 635 ms
63,340 KB
testcase_08 AC 623 ms
63,708 KB
testcase_09 AC 648 ms
65,900 KB
testcase_10 AC 670 ms
64,920 KB
testcase_11 AC 603 ms
64,420 KB
testcase_12 AC 628 ms
67,288 KB
testcase_13 AC 649 ms
64,420 KB
testcase_14 AC 616 ms
64,932 KB
testcase_15 AC 638 ms
63,932 KB
testcase_16 AC 626 ms
64,964 KB
testcase_17 AC 491 ms
62,492 KB
testcase_18 AC 433 ms
60,696 KB
testcase_19 AC 451 ms
61,076 KB
testcase_20 AC 454 ms
60,424 KB
testcase_21 AC 518 ms
60,544 KB
testcase_22 AC 510 ms
62,980 KB
testcase_23 AC 527 ms
61,316 KB
testcase_24 AC 622 ms
63,236 KB
testcase_25 AC 557 ms
62,780 KB
testcase_26 AC 622 ms
63,660 KB
testcase_27 AC 626 ms
63,120 KB
testcase_28 AC 121 ms
55,408 KB
testcase_29 AC 131 ms
55,680 KB
testcase_30 AC 120 ms
55,840 KB
testcase_31 AC 489 ms
60,672 KB
testcase_32 AC 494 ms
58,976 KB
testcase_33 AC 456 ms
60,532 KB
testcase_34 AC 480 ms
60,916 KB
testcase_35 AC 550 ms
60,960 KB
testcase_36 AC 547 ms
61,268 KB
testcase_37 AC 537 ms
62,488 KB
testcase_38 AC 121 ms
55,808 KB
testcase_39 AC 120 ms
55,740 KB
testcase_40 AC 510 ms
60,708 KB
testcase_41 AC 376 ms
60,408 KB
testcase_42 AC 196 ms
58,556 KB
testcase_43 AC 314 ms
60,620 KB
testcase_44 AC 238 ms
59,764 KB
testcase_45 AC 346 ms
60,028 KB
testcase_46 AC 294 ms
60,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        PriorityQueue<Integer> queue = new PriorityQueue<>();
        for (int i = 0; i < n; i++) {
            queue.add(sc.nextInt());
        }
        int sum = 0;
        while (queue.size() > 1) {
            sum += queue.poll() / 2;
        }
        sum += queue.poll();
        System.out.println(sum);
    }
}
0