結果

問題 No.549 素材合成システム
ユーザー tentententen
提出日時 2023-04-14 13:46:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 255 ms / 2,000 ms
コード長 1,747 bytes
コンパイル時間 3,743 ms
コンパイル使用メモリ 89,476 KB
実行使用メモリ 45,592 KB
最終ジャッジ日時 2024-04-18 12:34:28
合計ジャッジ時間 11,533 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
37,308 KB
testcase_01 AC 50 ms
37,256 KB
testcase_02 AC 51 ms
36,888 KB
testcase_03 AC 50 ms
37,360 KB
testcase_04 AC 51 ms
36,756 KB
testcase_05 AC 51 ms
37,272 KB
testcase_06 AC 51 ms
37,288 KB
testcase_07 AC 255 ms
45,348 KB
testcase_08 AC 212 ms
45,592 KB
testcase_09 AC 247 ms
45,432 KB
testcase_10 AC 242 ms
45,284 KB
testcase_11 AC 217 ms
45,492 KB
testcase_12 AC 215 ms
45,228 KB
testcase_13 AC 222 ms
45,524 KB
testcase_14 AC 247 ms
45,444 KB
testcase_15 AC 214 ms
45,224 KB
testcase_16 AC 221 ms
45,144 KB
testcase_17 AC 157 ms
44,644 KB
testcase_18 AC 154 ms
44,336 KB
testcase_19 AC 164 ms
45,480 KB
testcase_20 AC 161 ms
44,828 KB
testcase_21 AC 217 ms
45,060 KB
testcase_22 AC 201 ms
44,968 KB
testcase_23 AC 191 ms
45,148 KB
testcase_24 AC 219 ms
44,852 KB
testcase_25 AC 217 ms
45,032 KB
testcase_26 AC 224 ms
45,120 KB
testcase_27 AC 225 ms
45,276 KB
testcase_28 AC 50 ms
37,232 KB
testcase_29 AC 53 ms
36,888 KB
testcase_30 AC 53 ms
37,308 KB
testcase_31 AC 159 ms
44,304 KB
testcase_32 AC 162 ms
44,536 KB
testcase_33 AC 162 ms
44,432 KB
testcase_34 AC 161 ms
44,444 KB
testcase_35 AC 194 ms
45,540 KB
testcase_36 AC 158 ms
44,836 KB
testcase_37 AC 165 ms
44,848 KB
testcase_38 AC 52 ms
37,288 KB
testcase_39 AC 51 ms
37,076 KB
testcase_40 AC 197 ms
44,528 KB
testcase_41 AC 140 ms
41,168 KB
testcase_42 AC 68 ms
38,192 KB
testcase_43 AC 105 ms
41,000 KB
testcase_44 AC 97 ms
39,356 KB
testcase_45 AC 114 ms
41,664 KB
testcase_46 AC 108 ms
40,232 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);
        long ans = values[n - 1];
        for (int i = 0; i < n - 1; i++) {
            ans += values[i] / 2;
        }
        System.out.println(ans);
    }
}
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