結果

問題 No.227 簡単ポーカー
ユーザー ooh_21ooh_21
提出日時 2017-06-01 10:56:36
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 29 ms / 5,000 ms
コード長 1,830 bytes
コンパイル時間 957 ms
コンパイル使用メモリ 113,036 KB
実行使用メモリ 25,464 KB
最終ジャッジ日時 2023-10-21 20:11:57
合計ジャッジ時間 2,015 ms
ジャッジサーバーID
(参考情報)
judge9 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
25,464 KB
testcase_01 AC 29 ms
25,464 KB
testcase_02 AC 29 ms
25,464 KB
testcase_03 AC 28 ms
25,464 KB
testcase_04 AC 27 ms
25,464 KB
testcase_05 AC 28 ms
25,464 KB
testcase_06 AC 28 ms
25,464 KB
testcase_07 AC 27 ms
25,464 KB
testcase_08 AC 29 ms
25,464 KB
testcase_09 AC 29 ms
25,464 KB
testcase_10 AC 27 ms
25,464 KB
testcase_11 AC 27 ms
25,464 KB
testcase_12 AC 27 ms
25,464 KB
testcase_13 AC 26 ms
25,464 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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace pj8
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] cards = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray();

            Array.Sort(cards);

            int excard = cards[0];
            int fullcheck = cards[0];

            int yaku = 0;
            int Ayaku = 0;

            String pair = "NO HAND";

            bool Acard = false;
            bool full = true;

            for(int i = 1;i < cards.Length;i++)
            {
                if(cards[i] == excard)
                {
                    if (Acard == false)
                    {
                        yaku++;
                    }
                    else
                    {
                        Ayaku++;
                    }
                }
                else
                {
                    excard = cards[i];
                    if(yaku > 0)
                    {
                        Acard = true;
                    }
                }
            }
            switch (yaku)
            {
                case 1:
                    pair = "ONE PAIR";
                    if (Ayaku == 2)
                    {
                        pair = "FULL HOUSE";
                    }
                    else if (Ayaku == 1)
                    {
                        pair = "TWO PAIR";
                    }
                    break;
                case 2:
                    pair = "THREE CARD";
                    if (Ayaku == 1)
                    {
                        pair = "FULL HOUSE";
                    }
                    break;
            }
            Console.WriteLine(pair);
            
        }
    }
}
0