結果

問題 No.750 Frac #1
ユーザー abL8ZLsTbFabL8ZLsTbF
提出日時 2018-11-09 21:42:11
言語 C#
(csc 3.9.0)
結果
AC  
実行時間 69 ms / 1,000 ms
コード長 839 bytes
コンパイル時間 2,264 ms
実行使用メモリ 20,320 KB
最終ジャッジ日時 2022-12-26 19:48:42
合計ジャッジ時間 6,139 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
20,224 KB
testcase_01 AC 67 ms
18,240 KB
testcase_02 AC 68 ms
18,088 KB
testcase_03 AC 68 ms
20,192 KB
testcase_04 AC 68 ms
20,092 KB
testcase_05 AC 67 ms
20,224 KB
testcase_06 AC 68 ms
18,196 KB
testcase_07 AC 68 ms
18,056 KB
testcase_08 AC 67 ms
18,068 KB
testcase_09 AC 67 ms
18,168 KB
testcase_10 AC 67 ms
18,228 KB
testcase_11 AC 68 ms
20,208 KB
testcase_12 AC 68 ms
20,156 KB
testcase_13 AC 67 ms
18,052 KB
testcase_14 AC 67 ms
20,276 KB
testcase_15 AC 66 ms
20,240 KB
testcase_16 AC 68 ms
20,260 KB
testcase_17 AC 69 ms
20,176 KB
testcase_18 AC 67 ms
20,192 KB
testcase_19 AC 67 ms
20,148 KB
testcase_20 AC 66 ms
18,092 KB
testcase_21 AC 69 ms
18,148 KB
testcase_22 AC 69 ms
20,156 KB
testcase_23 AC 68 ms
18,256 KB
testcase_24 AC 68 ms
18,152 KB
testcase_25 AC 68 ms
18,304 KB
testcase_26 AC 68 ms
18,104 KB
testcase_27 AC 67 ms
20,320 KB
testcase_28 AC 67 ms
20,216 KB
testcase_29 AC 67 ms
18,092 KB
testcase_30 AC 68 ms
20,184 KB
testcase_31 AC 67 ms
18,236 KB
testcase_32 AC 67 ms
20,196 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.Text.RegularExpressions;

class Program
{
    static void Main(string[] args)
    {
        int n = int.Parse(Console.ReadLine());
        Fraction[] frac = new Fraction[n];
        for (int i = 0; i < n; i++)
        {
            var AB = Console.ReadLine().Split().Select(int.Parse);
            frac[i] = new Fraction { Numerator = AB.First(), Denominator = AB.Last() };
        }
        frac = frac.OrderByDescending(i => i.Numerator / (double)i.Denominator).ToArray();
        foreach (var item in frac)
        {
            Console.WriteLine($"{item.Numerator} {item.Denominator}");
        }
    }
}

public class Fraction
{
    public int Numerator { get; set; }  // 分子
    public int Denominator { get; set; }    // 分母
}
0