結果

問題 No.268 ラッピング(Easy)
ユーザー qazqaz
提出日時 2017-05-20 16:39:47
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 34 ms / 5,000 ms
コード長 909 bytes
コンパイル時間 922 ms
コンパイル使用メモリ 110,880 KB
実行使用メモリ 25,376 KB
最終ジャッジ日時 2023-10-19 04:12:16
合計ジャッジ時間 2,034 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
25,368 KB
testcase_01 AC 33 ms
25,376 KB
testcase_02 AC 33 ms
25,376 KB
testcase_03 AC 33 ms
25,368 KB
testcase_04 AC 32 ms
25,368 KB
testcase_05 AC 33 ms
25,376 KB
testcase_06 AC 33 ms
25,368 KB
testcase_07 AC 33 ms
25,368 KB
testcase_08 AC 34 ms
25,376 KB
testcase_09 AC 33 ms
25,376 KB
testcase_10 AC 32 ms
25,368 KB
testcase_11 AC 33 ms
25,376 KB
testcase_12 AC 34 ms
25,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

public class Program
{
    public static void Main() {
        string[] d = Console.ReadLine().Split(' ');
        int L1 = int.Parse(d[0]);
        int L2 = int.Parse(d[1]);
        int L3 = int.Parse(d[2]);

        d = Console.ReadLine().Split(' ');
        int R = int.Parse(d[0]);
        int B = int.Parse(d[1]);
        int Y = int.Parse(d[2]);

        var c = new List<int>();
        c.Add(R);
        c.Add(B);
        c.Add(Y);

        var l = new List<int>();
        l.Add(L1 * 2 + L2 * 2);
        l.Add(L2 * 2 + L3 * 2);
        l.Add(L3 * 2 + L1 * 2);

        var cc = c.OrderByDescending(x => x);
        var len = l.OrderBy(x => x);

        int re = 0;
        for (var i = 0; i <= 2; i++) {
            re += cc.Skip(i).FirstOrDefault() * len.Skip(i).FirstOrDefault();
        }

        Console.WriteLine(re);
    }
}
0