結果

問題 No.268 ラッピング(Easy)
ユーザー GrenacheGrenache
提出日時 2015-08-21 22:44:06
言語 Java19
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 732 bytes
コンパイル時間 4,899 ms
コンパイル使用メモリ 72,328 KB
実行使用メモリ 56,128 KB
最終ジャッジ日時 2023-09-25 14:58:56
合計ジャッジ時間 5,718 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
56,072 KB
testcase_01 AC 126 ms
56,104 KB
testcase_02 AC 125 ms
56,052 KB
testcase_03 AC 124 ms
55,896 KB
testcase_04 AC 125 ms
55,864 KB
testcase_05 AC 125 ms
55,984 KB
testcase_06 AC 123 ms
55,828 KB
testcase_07 AC 123 ms
56,128 KB
testcase_08 AC 124 ms
55,664 KB
testcase_09 AC 125 ms
55,924 KB
testcase_10 AC 125 ms
55,724 KB
testcase_11 AC 125 ms
55,920 KB
testcase_12 AC 124 ms
55,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;


public class Main_yukicoder268 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int[] l = new int[3];
        int[] ll = new int[3];
        int[] c = new int[3];
        for (int i = 0; i < 3; i++) {
        	l[i] = sc.nextInt();
        }
        ll[0] = l[0] + l[1];
        ll[1] = l[1] + l[2];
        ll[2] = l[0] + l[2];
        for (int i = 0; i < 3; i++) {
        	c[i] = sc.nextInt();
        }
        Arrays.sort(ll);
        Arrays.sort(c);

        int ret = 0;
        for (int i = 0; i < 3; i++) {
        	ret += 2 * ll[i] * c[2 - i];
        }

        System.out.println(ret);

        sc.close();
    }
}
0