結果

問題 No.268 ラッピング(Easy)
ユーザー 37zigen37zigen
提出日時 2016-05-03 23:53:00
言語 Java21
(openjdk 21)
結果
AC  
実行時間 148 ms / 5,000 ms
コード長 544 bytes
コンパイル時間 2,273 ms
コンパイル使用メモリ 74,868 KB
実行使用メモリ 41,920 KB
最終ジャッジ日時 2024-04-15 11:08:15
合計ジャッジ時間 4,947 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
41,892 KB
testcase_01 AC 137 ms
41,596 KB
testcase_02 AC 139 ms
41,564 KB
testcase_03 AC 143 ms
41,468 KB
testcase_04 AC 143 ms
41,492 KB
testcase_05 AC 137 ms
41,576 KB
testcase_06 AC 141 ms
41,632 KB
testcase_07 AC 139 ms
41,672 KB
testcase_08 AC 139 ms
41,748 KB
testcase_09 AC 147 ms
41,920 KB
testcase_10 AC 148 ms
41,812 KB
testcase_11 AC 143 ms
41,452 KB
testcase_12 AC 140 ms
41,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;
import java.util.Arrays;
import java.util.Scanner;
public class Main{
	public static void main(String[] args)throws Exception{
		new Main().solve();
	}
	void solve(){
		Scanner sc=new Scanner(System.in);
		int[] l=new int[3];
		for(int i=0;i<3;i++)l[i]=sc.nextInt();
		int[] d=new int[3];
		for(int i=0;i<3;i++)d[i]=sc.nextInt();
		Arrays.sort(d);
		
		int s_sum=l[0]+l[1]+l[2];
		for(int i=0;i<3;i++)l[i]=2*(s_sum-l[i]);
		Arrays.sort(l);
		int ans=0;
		for(int i=0;i<3;i++)ans+=l[i]*d[2-i];
		System.out.println(ans);
	}
}
0