結果

問題 No.268 ラッピング(Easy)
ユーザー kou6839kou6839
提出日時 2015-08-22 20:12:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 5,000 ms
コード長 595 bytes
コンパイル時間 2,136 ms
コンパイル使用メモリ 71,492 KB
実行使用メモリ 56,108 KB
最終ジャッジ日時 2023-09-25 16:14:32
合計ジャッジ時間 4,702 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
56,028 KB
testcase_01 AC 126 ms
55,840 KB
testcase_02 AC 127 ms
55,940 KB
testcase_03 AC 123 ms
55,856 KB
testcase_04 AC 123 ms
55,836 KB
testcase_05 AC 125 ms
56,108 KB
testcase_06 AC 123 ms
53,820 KB
testcase_07 AC 125 ms
55,732 KB
testcase_08 AC 126 ms
55,560 KB
testcase_09 AC 126 ms
56,104 KB
testcase_10 AC 125 ms
55,928 KB
testcase_11 AC 125 ms
55,852 KB
testcase_12 AC 124 ms
55,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;


public class Main {
    public static void main(String[] args){
        // TODO 自動生成されたメソッド・スタブ
    	Scanner sc = new Scanner(System.in);
  	int[] hako = new int[3];
  	int[] kai = new int[3];
  	for(int i=0;i<3;i++){
  		hako[i]=sc.nextInt();
  	}
  	for(int i=0;i<3;i++) kai[i]=sc.nextInt();
  	int[] need = new int[3];
  	for(int i=0;i<3;i++){
  		need[i]=2*(hako[i]+hako[(i+1)%3]);
  	}
  	Arrays.sort(need);
  	Arrays.sort(kai);
  	int ans=0;
  	for(int i=0;i<3;i++){
  		ans+=need[i]*kai[2-i];
  	}
    System.out.println(ans);
    }
}
0