結果

問題 No.267 トランプソート
ユーザー しらゆきしらゆき
提出日時 2016-01-05 20:16:56
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 27 ms / 1,000 ms
コード長 3,139 bytes
コンパイル時間 2,429 ms
コンパイル使用メモリ 113,584 KB
実行使用メモリ 24,072 KB
最終ジャッジ日時 2023-10-19 15:21:42
合計ジャッジ時間 4,096 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

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

class Program
{
    static void Main()
    {
        var n = ri();
        var memo = new bool[4, 13];
        var card = new string[4, 13];
        for(int i = 0; i < 4; i++)
        {            
            for(int j = 0; j < 13; j++)
            {
                switch (i)
                {
                    case 0: card[i, j] += "D"; break;
                    case 1: card[i, j] += "C"; break;
                    case 2: card[i, j] += "H"; break;
                    case 3: card[i, j] += "S"; break;
                }
                switch (j)
                {
                    case 0: card[i, j] += "A"; break;
                    case 1: card[i, j] += "2"; break;
                    case 2: card[i, j] += "3"; break;
                    case 3: card[i, j] += "4"; break;
                    case 4: card[i, j] += "5"; break;
                    case 5: card[i, j] += "6"; break;
                    case 6: card[i, j] += "7"; break;
                    case 7: card[i, j] += "8"; break;
                    case 8: card[i, j] += "9"; break;
                    case 9: card[i, j] += "T"; break;
                    case 10: card[i, j] += "J"; break;
                    case 11: card[i, j] += "Q"; break;
                    case 12: card[i, j] += "K"; break;
                }

            }
        }
        var mn = rsa();
        for(int i = 0; i < n; i++)
        {
            for(int j = 0; j < 4; j++)
            {
                for(int k = 0; k < 13; k++)
                {
                    if (mn[i] == card[j, k])
                        memo[j, k] = true;
                }
            }
        }

        var cnt = 0;

        for (int j = 0; j < 4; j++)
        {
            for (int k = 0; k < 13; k++)
            {
                if (memo[j, k])
                {
                    if (cnt != n - 1)
                    {
                        Console.Write(card[j, k] + " ");
                        cnt++;
                    }
                    else Console.WriteLine(card[j, k]);
                } 
            }
        }
    }

    #region Scan
    static int ri() { return int.Parse(Console.ReadLine()); }
    static long rl() { return long.Parse(Console.ReadLine()); }
    static double rd() { return double.Parse(Console.ReadLine()); }
    static string rs() { return Console.ReadLine(); }
    static int[] ria() { return Console.ReadLine().Trim().Split().Select(int.Parse).ToArray(); }
    static long[] rla() { return Console.ReadLine().Trim().Split().Select(long.Parse).ToArray(); }
    static double[] rda() { return Console.ReadLine().Trim().Split().Select(double.Parse).ToArray(); }
    static string[] rsa() { return Console.ReadLine().Trim().Split(); }
    static void mul(out int a, out int b) { var arr = ria(); a = arr[0]; b = arr[1]; }
    public void mul(out int a, out int b, out int c) { var arr = ria(); a = arr[0]; b = arr[1]; c = arr[2]; }
    public void mul(out int a, out int b, out int c, out int d) { var arr = ria(); a = arr[0]; b = arr[1]; c = arr[2]; d = arr[3]; }
    #endregion
}
0