結果

問題 No.549 素材合成システム
ユーザー tentententen
提出日時 2022-08-02 10:30:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 247 ms / 2,000 ms
コード長 1,191 bytes
コンパイル時間 2,137 ms
コンパイル使用メモリ 74,980 KB
実行使用メモリ 57,104 KB
最終ジャッジ日時 2023-09-30 09:17:34
合計ジャッジ時間 12,339 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
49,408 KB
testcase_01 AC 45 ms
49,484 KB
testcase_02 AC 45 ms
47,960 KB
testcase_03 AC 45 ms
49,512 KB
testcase_04 AC 45 ms
50,012 KB
testcase_05 AC 46 ms
49,472 KB
testcase_06 AC 45 ms
49,512 KB
testcase_07 AC 235 ms
56,504 KB
testcase_08 AC 242 ms
57,076 KB
testcase_09 AC 244 ms
56,884 KB
testcase_10 AC 215 ms
56,560 KB
testcase_11 AC 236 ms
56,560 KB
testcase_12 AC 236 ms
57,104 KB
testcase_13 AC 230 ms
54,748 KB
testcase_14 AC 243 ms
56,492 KB
testcase_15 AC 247 ms
56,908 KB
testcase_16 AC 225 ms
56,588 KB
testcase_17 AC 172 ms
56,016 KB
testcase_18 AC 147 ms
55,928 KB
testcase_19 AC 172 ms
56,280 KB
testcase_20 AC 151 ms
55,628 KB
testcase_21 AC 199 ms
55,988 KB
testcase_22 AC 188 ms
56,088 KB
testcase_23 AC 184 ms
55,900 KB
testcase_24 AC 229 ms
56,652 KB
testcase_25 AC 225 ms
56,524 KB
testcase_26 AC 231 ms
55,064 KB
testcase_27 AC 220 ms
56,580 KB
testcase_28 AC 45 ms
49,892 KB
testcase_29 AC 45 ms
49,488 KB
testcase_30 AC 45 ms
49,404 KB
testcase_31 AC 163 ms
56,124 KB
testcase_32 AC 172 ms
56,508 KB
testcase_33 AC 170 ms
56,696 KB
testcase_34 AC 163 ms
57,048 KB
testcase_35 AC 206 ms
56,376 KB
testcase_36 AC 160 ms
56,300 KB
testcase_37 AC 179 ms
56,440 KB
testcase_38 AC 45 ms
49,620 KB
testcase_39 AC 45 ms
49,472 KB
testcase_40 AC 198 ms
55,760 KB
testcase_41 AC 145 ms
55,364 KB
testcase_42 AC 64 ms
50,756 KB
testcase_43 AC 118 ms
54,116 KB
testcase_44 AC 95 ms
52,088 KB
testcase_45 AC 120 ms
54,424 KB
testcase_46 AC 91 ms
51,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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 = 0;
        for (int i = 0; i < n - 1; i++) {
            ans += values[i] / 2;
        }
        System.out.println(ans + values[n - 1]);
    }
}

class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    
    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 String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}
0