結果
| 問題 |
No.1628 Sorting Integers (MAX of M)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-10-25 10:40:29 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 680 bytes |
| コンパイル時間 | 3,669 ms |
| コンパイル使用メモリ | 109,696 KB |
| 実行使用メモリ | 26,028 KB |
| 最終ジャッジ日時 | 2024-10-03 01:42:03 |
| 合計ジャッジ時間 | 4,164 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 5 WA * 1 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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().Split(' ').ToArray();
string s = "123456789";
var ans = new List<string>();
for(int i = 0; i < N; i++)
{
if (num[i] == "0") continue;
else
{
ans.Add(new string(s[i], Convert.ToInt32(num[i])));
}
}
ans.Sort();
ans.Reverse();
foreach(var n in ans)
{
Console.Write(n);
}
Console.WriteLine();
}
}