結果

問題 No.267 トランプソート
ユーザー bluemeganebluemegane
提出日時 2018-10-01 22:23:30
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 36 ms / 1,000 ms
コード長 1,135 bytes
コンパイル時間 2,349 ms
コンパイル使用メモリ 109,568 KB
実行使用メモリ 19,456 KB
最終ジャッジ日時 2024-04-20 14:22:31
合計ジャッジ時間 3,478 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
19,200 KB
testcase_01 AC 35 ms
19,328 KB
testcase_02 AC 34 ms
18,944 KB
testcase_03 AC 33 ms
19,200 KB
testcase_04 AC 34 ms
18,944 KB
testcase_05 AC 34 ms
19,328 KB
testcase_06 AC 34 ms
19,200 KB
testcase_07 AC 34 ms
19,072 KB
testcase_08 AC 34 ms
19,200 KB
testcase_09 AC 35 ms
19,200 KB
testcase_10 AC 35 ms
19,200 KB
testcase_11 AC 36 ms
19,328 KB
testcase_12 AC 35 ms
19,200 KB
testcase_13 AC 36 ms
19,328 KB
testcase_14 AC 35 ms
19,456 KB
testcase_15 AC 35 ms
19,200 KB
testcase_16 AC 36 ms
19,328 KB
testcase_17 AC 36 ms
19,456 KB
testcase_18 AC 35 ms
19,072 KB
testcase_19 AC 35 ms
19,072 KB
testcase_20 AC 35 ms
19,328 KB
testcase_21 AC 35 ms
19,328 KB
testcase_22 AC 35 ms
19,328 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

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

public class P
{
    public int m2 { get; set; }
    public char m { get; set; }
    public int na2 { get; set; }
    public char na { get; set; }
}

public class Hello
{
    public static void Main()
    {
        var m = new char[] { 'D', 'C', 'H', 'S', 'A', 'T', 'J', 'Q', 'K' };
        var m2 = new int[] { 0, 1, 2, 3, 1, 10, 11, 12, 13 };
        var d = new Dictionary<char, int>();
        for (int i = 0; i < 9; i++) d[m[i]] = m2[i];
        var n = int.Parse(Console.ReadLine().Trim());
        string[] s = Console.ReadLine().Trim().Split(' ');
        var ps = new P[n];
        for (int i = 0; i < n; i++)
        {
            int w;
            if (d.ContainsKey(s[i][1])) w = d[s[i][1]];
            else w = int.Parse(s[i][1].ToString());
            ps[i] = new P { m = s[i][0], m2 = d[s[i][0]], na = s[i][1], na2 = w };
        }
        var ans = new string[n];
        var p = 0;
        foreach (var x in ps.OrderBy(y => y.m2).ThenBy(y => y.na2))
            ans[p++] = "" + x.m + x.na;
        Console.WriteLine(string.Join(" ", ans));
    }
}
0