結果

問題 No.227 簡単ポーカー
ユーザー Maeda
提出日時 2025-04-01 09:39:06
言語 C#
(.NET 8.0.404)
結果
AC  
実行時間 48 ms / 5,000 ms
コード長 1,254 bytes
コンパイル時間 9,372 ms
コンパイル使用メモリ 174,460 KB
実行使用メモリ 186,644 KB
最終ジャッジ日時 2025-04-01 09:39:18
合計ジャッジ時間 8,923 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (102 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

    class Program
    {
        static void Main(string[] args)
        {
            int[] onHand = new int[13];
            string[] card = Console.ReadLine().Split(' ');
            for(int i = 0; i < 5; i++)
            {
                onHand[int.Parse(card[i])-1]++;
            }
            int countPAIR = 0;
            int countTHREE = 0;
            for(int i = 0; i < 13; i++)
            {
                if (onHand[i] == 2)
                {
                    countPAIR++;
                }else if (onHand[i] == 3)
                {
                    countTHREE++;
                }
            }

            string result = "";
            if(countTHREE == 1 && countPAIR == 1)
            {
                result = "FULL HOUSE";
            }else if(countTHREE == 1 && countPAIR == 0)
            {
                result = "THREE CARD";
            }
            else if (countTHREE == 0 && countPAIR == 2)
            {
                result = "TWO PAIR";
            }
            else if (countTHREE == 0 && countPAIR == 1)
            {
                result = "ONE PAIR";
            }
            else
            {
                result = "NO HAND";
            }
            Console.WriteLine(result);
        }
    }
0