結果
| 問題 |
No.267 トランプソート
|
| コンテスト | |
| ユーザー |
No
|
| 提出日時 | 2015-11-04 17:11:03 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 1,000 ms |
| コード長 | 1,251 bytes |
| コンパイル時間 | 1,074 ms |
| コンパイル使用メモリ | 112,180 KB |
| 実行使用メモリ | 26,864 KB |
| 最終ジャッジ日時 | 2024-09-13 12:25:08 |
| 合計ジャッジ時間 | 2,454 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
コンパイルメッセージ
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;
using System.Threading.Tasks;
namespace Yuki
{
class Program
{
static void Main(string[] args)
{
int N = int.Parse(Console.ReadLine());
string s = Console.ReadLine();
s = s.Replace("A", "1");
s = s.Replace("T", "w");
s = s.Replace("J", "x");
s = s.Replace("Q", "y");
s = s.Replace("K", "z");
s = s.Replace("D", "a");
s = s.Replace("C", "b");
s = s.Replace("H", "c");
s = s.Replace("S", "d");
var li = new List<string>();
foreach (var c in s.Split()) li.Add(c);
li.Sort();
s = "";
foreach (var c in li) s += c + " ";
s = s.Remove(s.Length - 1);
s = s.Replace("1", "A");
s = s.Replace("w", "T");
s = s.Replace("x", "J");
s = s.Replace("y", "Q");
s = s.Replace("z", "K");
s = s.Replace("a", "D");
s = s.Replace("b", "C");
s = s.Replace("c", "H");
s = s.Replace("d", "S");
Console.WriteLine(s);
}
}
}
No