結果

問題 No.571 3人兄弟(その2)
ユーザー neko_the_shadowneko_the_shadow
提出日時 2017-10-15 00:57:54
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 1,097 bytes
コンパイル時間 2,439 ms
コンパイル使用メモリ 107,552 KB
実行使用メモリ 23,936 KB
最終ジャッジ日時 2023-08-11 02:39:59
合計ジャッジ時間 4,453 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
19,752 KB
testcase_01 AC 62 ms
19,868 KB
testcase_02 AC 65 ms
21,892 KB
testcase_03 AC 64 ms
22,052 KB
testcase_04 AC 62 ms
21,848 KB
testcase_05 AC 63 ms
21,756 KB
testcase_06 AC 63 ms
21,884 KB
testcase_07 AC 62 ms
21,908 KB
testcase_08 AC 62 ms
23,888 KB
testcase_09 AC 64 ms
23,920 KB
testcase_10 AC 63 ms
19,932 KB
testcase_11 AC 63 ms
20,016 KB
testcase_12 AC 62 ms
21,868 KB
testcase_13 AC 62 ms
23,936 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;
using System.Text;
using System.Threading.Tasks;


class Person
{
    private char name;
    private int height;
    private int weight;

    public Person(char name, int height, int weight)
    {
        this.name = name;
        this.height = height;
        this.weight = weight;
    }

    public char Name { get {return this.name; }}
    public int Height { get { return this.height; } }
    public int Weight { get { return this.weight; } }

}

class Program
{
    static void Main(string[] args)
    {
        var persons = new List<Person>();
        for (char name = 'A'; ; name++)
        {
            var line = Console.ReadLine();
            if (line == null) break;

            var tokens = line.Split(' ').Select(int.Parse).ToArray();
            persons.Add(new Person(name, tokens[0], tokens[1]));
        }

        var sortedPersons = persons.OrderByDescending((person) => person.Height).ThenBy((person) => person.Weight);
        foreach (var person in sortedPersons) Console.WriteLine(person.Name);
    }
}
0