結果
| 問題 |
No.1628 Sorting Integers (MAX of M)
|
| コンテスト | |
| ユーザー |
bluemegane
|
| 提出日時 | 2021-07-30 22:17:24 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 2,000 ms |
| コード長 | 559 bytes |
| コンパイル時間 | 838 ms |
| コンパイル使用メモリ | 104,704 KB |
| 実行使用メモリ | 17,792 KB |
| 最終ジャッジ日時 | 2024-09-16 00:43:33 |
| 合計ジャッジ時間 | 1,814 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 6 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
public class Hello
{
static void Main()
{
var n = int.Parse(Console.ReadLine().Trim());
string[] line = Console.ReadLine().Trim().Split(' ');
var a = Array.ConvertAll(line, int.Parse);
getAns(n, a);
}
static void getAns (int n, int[] a)
{
var ans = "";
var t = "987654321";
Array.Reverse(a);
for (int i = 0; i < 9; i++)
{
if (a[i] == 0) continue;
ans += new string(t[i], a[i]);
}
Console.WriteLine(ans);
}
}
bluemegane