結果
| 問題 |
No.268 ラッピング(Easy)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-04-05 21:33:25 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 29 ms / 5,000 ms |
| コード長 | 629 bytes |
| コンパイル時間 | 946 ms |
| コンパイル使用メモリ | 110,828 KB |
| 実行使用メモリ | 26,220 KB |
| 最終ジャッジ日時 | 2024-10-04 02:05:05 |
| 合計ジャッジ時間 | 1,950 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
public class Program {
public static void Main() {
int[] length = Array.ConvertAll<string, int>(Console.ReadLine().Split(), value => int.Parse(value));
int[] ribbon = Array.ConvertAll<string, int>(Console.ReadLine().Split(), value => int.Parse(value));
Array.Sort(ribbon);
int[] wrap = new int[3];
for (int i = 0; i < 3; i++) wrap[i] = length[i]+length[(i+1)%3];
Array.Sort(wrap);
Array.Reverse(wrap);
int ans = 0;
for (int i = 0; i < 3; i++) {
ans += wrap[i] * 2 * ribbon[i];
}
Console.WriteLine(ans);
}
}