結果
| 問題 | No.571 3人兄弟(その2) | 
| コンテスト | |
| ユーザー |  neko_the_shadow | 
| 提出日時 | 2017-10-15 00:57:54 | 
| 言語 | C#(csc) (csc 3.9.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 35 ms / 2,000 ms | 
| コード長 | 1,097 bytes | 
| コンパイル時間 | 1,168 ms | 
| コンパイル使用メモリ | 115,016 KB | 
| 実行使用メモリ | 19,456 KB | 
| 最終ジャッジ日時 | 2024-11-17 14:55:08 | 
| 合計ジャッジ時間 | 2,146 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 12 | 
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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);
    }
}
            
            
            
        