結果
| 問題 |
No.268 ラッピング(Easy)
|
| コンテスト | |
| ユーザー |
htensai
|
| 提出日時 | 2019-12-17 16:01:59 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 50 ms / 5,000 ms |
| コード長 | 953 bytes |
| コンパイル時間 | 1,818 ms |
| コンパイル使用メモリ | 77,244 KB |
| 実行使用メモリ | 37,228 KB |
| 最終ジャッジ日時 | 2024-07-02 21:27:45 |
| 合計ジャッジ時間 | 3,149 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
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);
}
}
htensai