結果

問題 No.268 ラッピング(Easy)
ユーザー spaciaspacia
提出日時 2016-01-17 16:56:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 58 ms / 5,000 ms
コード長 729 bytes
コンパイル時間 4,389 ms
コンパイル使用メモリ 77,572 KB
実行使用メモリ 53,676 KB
最終ジャッジ日時 2023-10-20 00:30:04
合計ジャッジ時間 3,662 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
51,620 KB
testcase_01 AC 56 ms
53,672 KB
testcase_02 AC 56 ms
53,676 KB
testcase_03 AC 56 ms
53,668 KB
testcase_04 AC 56 ms
51,616 KB
testcase_05 AC 57 ms
53,664 KB
testcase_06 AC 57 ms
53,656 KB
testcase_07 AC 56 ms
53,672 KB
testcase_08 AC 56 ms
53,664 KB
testcase_09 AC 56 ms
52,548 KB
testcase_10 AC 56 ms
52,548 KB
testcase_11 AC 57 ms
53,660 KB
testcase_12 AC 58 ms
52,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

class Main {
	
	public static void out (Object o) {
		System.out.println(o);
	}
	
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		int size = 3;
		String[] line1 = br.readLine().split(" ");
		int[] a = new int[size];
		for (int i = 0; i < size; i++) a[i] = Integer.parseInt(line1[i]);
		
		String[] line2 = br.readLine().split(" ");
		int[] b = new int[size];
		for (int i = 0; i < size; i++) b[i] = Integer.parseInt(line2[i]);
		int[] c = new int[]{b[0] + b[1] , b[1] + b[2] , b[2] + b[0]};
		
		Arrays.sort(a);
		Arrays.sort(c);
		
		out(2 * (a[0] * c[2] + a[1] * c[1] + a[2] * c[0]));
	}
}
0