結果

問題 No.750 Frac #1
ユーザー kmtrc130
提出日時 2019-03-18 10:56:36
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 33 ms / 1,000 ms
コード長 585 bytes
コンパイル時間 891 ms
コンパイル使用メモリ 113,768 KB
実行使用メモリ 27,448 KB
最終ジャッジ日時 2024-07-18 01:25:28
合計ジャッジ時間 3,448 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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;

class Program
{
    public void Solve()
    {
        int n = int.Parse(Console.ReadLine());
        List<string> AB = new List<string>();
        for (int i = 0; i < n; i++)
        {
            AB.Add(Console.ReadLine());
        }

        foreach (var item in AB.OrderByDescending(x => (double.Parse(x.Split(' ')[0])/double.Parse(x.Split(' ')[1] ))))
        {
            Console.WriteLine(item);
        }
    }

    static void Main()
    {
        var solver = new Program();
        solver.Solve();
    }
}
0