結果

問題 No.750 Frac #1
ユーザー abL8ZLsTbFabL8ZLsTbF
提出日時 2018-11-09 21:42:11
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 35 ms / 1,000 ms
コード長 839 bytes
コンパイル時間 1,092 ms
コンパイル使用メモリ 115,076 KB
実行使用メモリ 27,604 KB
最終ジャッジ日時 2024-05-01 04:39:54
合計ジャッジ時間 3,392 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
27,560 KB
testcase_01 AC 33 ms
25,248 KB
testcase_02 AC 34 ms
25,644 KB
testcase_03 AC 34 ms
25,388 KB
testcase_04 AC 34 ms
27,428 KB
testcase_05 AC 34 ms
27,348 KB
testcase_06 AC 33 ms
25,264 KB
testcase_07 AC 34 ms
25,304 KB
testcase_08 AC 33 ms
27,296 KB
testcase_09 AC 34 ms
25,692 KB
testcase_10 AC 34 ms
25,556 KB
testcase_11 AC 34 ms
25,648 KB
testcase_12 AC 33 ms
25,300 KB
testcase_13 AC 35 ms
25,256 KB
testcase_14 AC 34 ms
25,308 KB
testcase_15 AC 34 ms
27,452 KB
testcase_16 AC 33 ms
25,308 KB
testcase_17 AC 34 ms
27,360 KB
testcase_18 AC 34 ms
27,604 KB
testcase_19 AC 34 ms
27,564 KB
testcase_20 AC 32 ms
25,504 KB
testcase_21 AC 34 ms
25,500 KB
testcase_22 AC 34 ms
25,644 KB
testcase_23 AC 34 ms
25,388 KB
testcase_24 AC 33 ms
27,420 KB
testcase_25 AC 33 ms
25,768 KB
testcase_26 AC 34 ms
25,556 KB
testcase_27 AC 34 ms
25,820 KB
testcase_28 AC 33 ms
25,260 KB
testcase_29 AC 34 ms
25,264 KB
testcase_30 AC 34 ms
25,516 KB
testcase_31 AC 35 ms
25,648 KB
testcase_32 AC 34 ms
27,476 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