結果

問題 No.8042 本棚
ユーザー bluemegane
提出日時 2019-04-02 07:38:13
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 557 bytes
コンパイル時間 897 ms
コンパイル使用メモリ 112,396 KB
実行使用メモリ 28,172 KB
最終ジャッジ日時 2024-06-28 01:55:31
合計ジャッジ時間 2,776 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System.Linq;
using System;

public class P
{
    public string a { get; set; }
    public string b { get; set; }
}

public class Hello
{
    static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        var ps = new P[n];
        for (int i = 0; i < n; i++)
        {
            string[] line = Console.ReadLine().Trim().Split(' ');
            ps[i] = new P { a = line[0], b = line[1] };
        }
        foreach (var x in ps.OrderBy(x => x.a).ThenBy(x => x.b))
            Console.WriteLine("{0} {1}", x.a, x.b);
    }
}

0