結果

問題 No.268 ラッピング(Easy)
コンテスト
ユーザー htensai
提出日時 2019-12-17 16:01:59
言語 Java
(openjdk 26.0.2.1 + ACL)
コンパイル:
javac -J-Duser.language=en -encoding UTF8 -cp /opt/aclib/ac_library.jar _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true -cp .:/opt/aclib/ac_library.jar _class_
結果
AC  
実行時間 32 ms / 5,000 ms
+ 613µs
コード長 953 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,476 ms
コンパイル使用メモリ 84,728 KB
実行使用メモリ 40,956 KB
最終ジャッジ日時 2026-08-04 06:28:21
合計ジャッジ時間 2,924 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] first = br.readLine().split(" ", 3);
        int[] lengths = new int[3];
        for (int i = 0; i < 3; i++) {
            lengths[i] = Integer.parseInt(first[i]);
        }
        int[] total = new int[3];
        total[0] = (lengths[0] + lengths[1]) * 2;
        total[1] = (lengths[1] + lengths[2]) * 2;
        total[2] = (lengths[2] + lengths[0]) * 2;
        Arrays.sort(total);
        String[] second = br.readLine().split(" ", 3);
        int[] colors = new int[3];
        for (int i = 0; i < 3; i++) {
            colors[i] = Integer.parseInt(second[i]);
        }
        Arrays.sort(colors);
        int ans = colors[0] * total[2] + colors[1] * total[1] + colors[2] * total[0];
        System.out.println(ans);
    }

}
0