結果

問題 No.1628 Sorting Integers (MAX of M)
ユーザー mobchanmobchan
提出日時 2023-04-23 22:39:05
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 60 ms / 2,000 ms
コード長 535 bytes
コンパイル時間 8,605 ms
コンパイル使用メモリ 167,172 KB
実行使用メモリ 185,572 KB
最終ジャッジ日時 2024-04-25 16:59:37
合計ジャッジ時間 9,957 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
30,844 KB
testcase_01 AC 59 ms
30,976 KB
testcase_02 AC 59 ms
30,840 KB
testcase_03 AC 59 ms
30,720 KB
testcase_04 AC 59 ms
30,720 KB
testcase_05 AC 60 ms
30,848 KB
testcase_06 AC 58 ms
30,848 KB
testcase_07 AC 58 ms
30,720 KB
testcase_08 AC 58 ms
30,720 KB
testcase_09 AC 58 ms
185,572 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (93 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        var N = int.Parse(Console.ReadLine());
        var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var list = new List<int>();

        for (int i = 0; i < 9; i++)
        {
            for (int j = 0; j < input[i]; j++) list.Add(i + 1);
        }
        list = list.OrderByDescending(x => x).ToList();
        list.ForEach(Console.Write);
        Console.WriteLine();
    }
}
0