結果
問題 | No.268 ラッピング(Easy) |
ユーザー |
![]() |
提出日時 | 2016-10-23 16:40:00 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 130 ms / 5,000 ms |
コード長 | 957 bytes |
コンパイル時間 | 2,130 ms |
コンパイル使用メモリ | 77,664 KB |
実行使用メモリ | 41,504 KB |
最終ジャッジ日時 | 2024-11-24 01:56:12 |
合計ジャッジ時間 | 4,590 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
import java.util.*;import java.math.*;import java.text.*;public class Main {private static Scanner sc = new Scanner(System.in);public static void main(String[] args) throws Exception {int l1 = sc.nextInt();int l2 = sc.nextInt();int l3 = sc.nextInt();int r = sc.nextInt();int b = sc.nextInt();int y = sc.nextInt();int ret = Integer.MAX_VALUE;ret = Math.min(ret, sum(l1, l2, l3, r, b, y));ret = Math.min(ret, sum(l1, l3, l2, r, b, y));ret = Math.min(ret, sum(l2, l1, l3, r, b, y));ret = Math.min(ret, sum(l2, l3, l1, r, b, y));ret = Math.min(ret, sum(l3, l1, l2, r, b, y));ret = Math.min(ret, sum(l3, l2, l1, r, b, y));System.out.println(ret);}public static int sum(int l1, int l2, int l3, int r, int b, int y) {return (l2+l3)*2*r + (l1+l2)*2*b + (l1+l3)*2*y;}}