結果

問題 No.1628 Sorting Integers (MAX of M)
ユーザー monpemonpe
提出日時 2021-10-25 13:48:13
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 682 bytes
コンパイル時間 814 ms
コンパイル使用メモリ 112,256 KB
実行使用メモリ 25,832 KB
最終ジャッジ日時 2024-04-14 08:04:09
合計ジャッジ時間 1,783 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
23,912 KB
testcase_01 AC 26 ms
23,916 KB
testcase_02 AC 25 ms
25,832 KB
testcase_03 AC 26 ms
23,844 KB
testcase_04 AC 26 ms
24,172 KB
testcase_05 AC 25 ms
24,104 KB
testcase_06 AC 25 ms
24,240 KB
testcase_07 AC 26 ms
23,916 KB
testcase_08 AC 26 ms
23,780 KB
testcase_09 AC 26 ms
23,780 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;

class Program
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        var num = Console.ReadLine().Trim().Split(' ');
        var number = Array.ConvertAll(num, int.Parse);

        Multi(N, number);
    }

    static void Multi(int N, int[] number)
    {
        string num = "987654321";
        var ans = "";

        Array.Reverse(number);
        for(int i = 0; i < 9; i++)
        {
            if (number[i] == 0) continue;
            {
                ans += new string(num[i], number[i]);
            }
        }
        Console.WriteLine(ans);
    }
}
0