結果

問題 No.267 トランプソート
ユーザー AreTrashAreTrash
提出日時 2016-05-02 09:17:59
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 28 ms / 1,000 ms
コード長 587 bytes
コンパイル時間 931 ms
コンパイル使用メモリ 116,848 KB
実行使用メモリ 25,940 KB
最終ジャッジ日時 2024-04-15 09:07:26
合計ジャッジ時間 2,570 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
23,724 KB
testcase_01 AC 28 ms
23,804 KB
testcase_02 AC 27 ms
25,820 KB
testcase_03 AC 25 ms
23,724 KB
testcase_04 AC 27 ms
25,720 KB
testcase_05 AC 26 ms
21,816 KB
testcase_06 AC 27 ms
23,772 KB
testcase_07 AC 27 ms
25,820 KB
testcase_08 AC 27 ms
23,984 KB
testcase_09 AC 26 ms
23,808 KB
testcase_10 AC 27 ms
23,808 KB
testcase_11 AC 26 ms
24,032 KB
testcase_12 AC 27 ms
23,772 KB
testcase_13 AC 27 ms
23,804 KB
testcase_14 AC 27 ms
25,716 KB
testcase_15 AC 27 ms
25,828 KB
testcase_16 AC 26 ms
25,940 KB
testcase_17 AC 26 ms
23,680 KB
testcase_18 AC 26 ms
25,844 KB
testcase_19 AC 27 ms
23,728 KB
testcase_20 AC 26 ms
23,680 KB
testcase_21 AC 26 ms
23,932 KB
testcase_22 AC 27 ms
25,692 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace No267_1{
    public class Program{
        public static void Main(string[] args){
            Console.ReadLine();
            var cards = Console.ReadLine().Split(' ');
            var suit = new[]{'D', 'C', 'H', 'S'};
            var num = new[]{'A', '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K'};

            Func<string, int> order = str => Array.IndexOf(suit, str[0]) * 13 + Array.IndexOf(num, str[1]);
            Array.Sort(cards, (s1, s2) => order(s1) - order(s2));
            Console.WriteLine(string.Join(" ", cards));
        }
    }
}
0