結果

問題 No.750 Frac #1
ユーザー yurara
提出日時 2019-04-11 23:44:09
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 37 ms / 1,000 ms
コード長 552 bytes
コンパイル時間 1,118 ms
コンパイル使用メモリ 115,320 KB
実行使用メモリ 28,008 KB
最終ジャッジ日時 2024-07-20 05:14:43
合計ジャッジ時間 3,252 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 void Main()
    {
        var ct = int.Parse(Console.ReadLine());
        var inputs = new List<List<double>>();

        for (var i = 0; i < ct; i++)
            inputs.Add(Console.ReadLine().Split(' ').Select(s => double.Parse(s)).ToList());

        inputs.Sort((a, b) => (a[0] / a[1]) < (b[0] / b[1]) ? 1 : -1);

        foreach ( var input in inputs )
            Console.WriteLine("{0} {1}", input[0], input[1]);

        return;
    }
}
0