結果

問題 No.570 3人兄弟(その1)
ユーザー TaK7907TaK7907
提出日時 2017-10-14 11:17:55
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 60 ms / 2,000 ms
コード長 1,177 bytes
コンパイル時間 3,188 ms
コンパイル使用メモリ 105,480 KB
実行使用メモリ 23,784 KB
最終ジャッジ日時 2023-08-11 01:54:17
合計ジャッジ時間 4,260 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
23,684 KB
testcase_01 AC 59 ms
21,664 KB
testcase_02 AC 59 ms
21,708 KB
testcase_03 AC 60 ms
21,792 KB
testcase_04 AC 60 ms
21,720 KB
testcase_05 AC 60 ms
23,784 KB
testcase_06 AC 59 ms
21,868 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 List<int> NumbersFromString(string input, char delimitor = ' ') {
        return input.Split( delimitor ).ToList<string>().ConvertAll<int>( int.Parse );
    }

    private static List<int> NumbersFromConsole(char delimitor = ' ') {
        return NumbersFromString( Console.ReadLine() );
    }

    private struct Bro {
        public string Name { get; set; }
        public int Height { get; set; }
    }

    private static void Main() {
        var Bros = new List<Bro>()
        {
            new Bro()
            {
                Name = "A",
                Height = int.Parse( s: Console.ReadLine())
            },
            new Bro()
            {
                Name = "B",
                Height=int.Parse( s: Console.ReadLine())
            },
            new Bro()
            {
                Name = "C",
                Height=int.Parse( s: Console.ReadLine())
            }
        };
        var BrosSorted = Bros.OrderByDescending( x => x.Height );
        foreach (var i in BrosSorted) {
            Console.WriteLine(i.Name);
        }
    }
}
0