結果

問題 No.227 簡単ポーカー
ユーザー miku_minatsukimiku_minatsuki
提出日時 2019-07-21 23:23:39
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,272 bytes
コンパイル時間 2,282 ms
コンパイル使用メモリ 107,428 KB
実行使用メモリ 23,428 KB
最終ジャッジ日時 2023-09-05 08:50:56
合計ジャッジ時間 3,831 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
23,284 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 50 ms
23,408 KB
testcase_06 AC 51 ms
23,368 KB
testcase_07 WA -
testcase_08 AC 50 ms
21,348 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Collections.Generic;
using System.Linq;

public class Program
{
    public static void Main(String[] args)
    {
        List<int> cards = new List<int>();
        foreach (string arg in args)
        {
            cards.Add(int.Parse(arg));
        }

        List<int> result = Search(cards);
        if (result.Contains(3) && result.Contains(2))
        {
            Console.WriteLine("FULL HOUSE");
        }
        else if (result.Contains(3))
        {
            Console.WriteLine("THREE CARD");
        }
        else if (result.Count(num => num == 2) == 2)
        {
            Console.WriteLine("TWO PAIR");
        }
        else if (result.Count(num => num == 2) == 1)
        {
            Console.WriteLine("ONE PAIR");
        }
        else
        {
            Console.WriteLine("NO HAND");
        }
    }

    private static List<int> Search(List<int> cards)
    {
        List<int> result = new List<int>();
        for (int i = 1; i <= 13; i++)
        {
            int count = 0;
            foreach (int card in cards)
            {
                if (card == i)
                {
                    count++;
                }
            }
            result.Add(count);
        }

        return result;
    }
}
0