結果

問題 No.549 素材合成システム
ユーザー tentententen
提出日時 2023-12-18 13:12:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 264 ms / 2,000 ms
コード長 1,733 bytes
コンパイル時間 2,620 ms
コンパイル使用メモリ 84,112 KB
実行使用メモリ 60,516 KB
最終ジャッジ日時 2023-12-18 13:12:59
合計ジャッジ時間 11,957 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
54,004 KB
testcase_01 AC 51 ms
54,008 KB
testcase_02 AC 51 ms
54,000 KB
testcase_03 AC 51 ms
51,980 KB
testcase_04 AC 50 ms
54,120 KB
testcase_05 AC 51 ms
54,108 KB
testcase_06 AC 51 ms
54,120 KB
testcase_07 AC 232 ms
60,212 KB
testcase_08 AC 230 ms
60,256 KB
testcase_09 AC 246 ms
60,268 KB
testcase_10 AC 223 ms
60,288 KB
testcase_11 AC 258 ms
60,420 KB
testcase_12 AC 233 ms
60,292 KB
testcase_13 AC 237 ms
60,228 KB
testcase_14 AC 222 ms
60,472 KB
testcase_15 AC 235 ms
60,252 KB
testcase_16 AC 264 ms
60,516 KB
testcase_17 AC 175 ms
59,160 KB
testcase_18 AC 154 ms
59,168 KB
testcase_19 AC 169 ms
59,212 KB
testcase_20 AC 156 ms
59,160 KB
testcase_21 AC 184 ms
59,500 KB
testcase_22 AC 222 ms
59,900 KB
testcase_23 AC 191 ms
59,504 KB
testcase_24 AC 228 ms
60,164 KB
testcase_25 AC 227 ms
60,204 KB
testcase_26 AC 217 ms
60,032 KB
testcase_27 AC 245 ms
60,308 KB
testcase_28 AC 52 ms
54,004 KB
testcase_29 AC 52 ms
54,108 KB
testcase_30 AC 51 ms
54,016 KB
testcase_31 AC 162 ms
59,636 KB
testcase_32 AC 183 ms
59,836 KB
testcase_33 AC 160 ms
59,372 KB
testcase_34 AC 163 ms
59,344 KB
testcase_35 AC 199 ms
59,980 KB
testcase_36 AC 182 ms
59,944 KB
testcase_37 AC 180 ms
57,972 KB
testcase_38 AC 52 ms
53,968 KB
testcase_39 AC 51 ms
54,008 KB
testcase_40 AC 205 ms
59,796 KB
testcase_41 AC 146 ms
56,284 KB
testcase_42 AC 81 ms
54,884 KB
testcase_43 AC 116 ms
57,820 KB
testcase_44 AC 106 ms
55,524 KB
testcase_45 AC 114 ms
58,020 KB
testcase_46 AC 106 ms
55,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.util.stream.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int n = sc.nextInt();
        int[] values = new int[n];
        for (int i = 0; i < n; i++) {
            values[i] = sc.nextInt();
        }
        Arrays.sort(values);
        for (int i = 0; i < n - 1; i++) {
            values[n - 1] += values[i] / 2;
        }
        System.out.println(values[n - 1]);
    }
}
class Utilities {
    static String arrayToLineString(Object[] arr) {
        return Arrays.stream(arr).map(x -> x.toString()).collect(Collectors.joining("\n"));
    }
    
    static String arrayToLineString(int[] arr) {
        return String.join("\n", Arrays.stream(arr).mapToObj(String::valueOf).toArray(String[]::new));
    }
}
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    StringBuilder sb = new StringBuilder();
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public int[] nextIntArray() throws Exception {
        return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }
    
    public String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
    
}
0