結果

問題 No.227 簡単ポーカー
ユーザー swdamdrswdamdr
提出日時 2017-01-25 13:34:49
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 1,246 bytes
コンパイル時間 2,452 ms
コンパイル使用メモリ 104,060 KB
実行使用メモリ 23,952 KB
最終ジャッジ日時 2023-08-24 22:08:52
合計ジャッジ時間 4,200 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
23,880 KB
testcase_01 AC 58 ms
21,864 KB
testcase_02 AC 58 ms
21,744 KB
testcase_03 AC 58 ms
21,936 KB
testcase_04 AC 59 ms
23,852 KB
testcase_05 AC 59 ms
21,848 KB
testcase_06 AC 59 ms
21,844 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 61 ms
23,952 KB
testcase_10 AC 59 ms
21,964 KB
testcase_11 AC 58 ms
21,820 KB
testcase_12 RE -
testcase_13 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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(string[] args)
    {
        int[] a = Console.ReadLine().Split().Select(b => int.Parse(b)).ToArray();
        int[] card = new int[13];
        string output = "NO HAND";

        for (int i = 0; i < 5; i++)
        {
            card[a[i]]++;
        }

        while (true)
        {
            if (Array.IndexOf(card, 3) > 0)
            {
                if (Array.IndexOf(card, 2) > 0)
                {
                    output = "FULL HOUSE";
                    break;
                }
                else
                {
                    output = "THREE CARD";
                    break;
                }
            }

            if (Array.IndexOf(card, 2) > 0)
            {
                card[Array.IndexOf(card, 2)] = 0;

                if (Array.IndexOf(card, 2) > 0)
                {
                    output = "TWO PAIR";
                    break;
                }
                else
                {
                    output = "ONE PAIR";
                    break;
                }
            }

            break;
        }

        Console.WriteLine(output);
        Console.Read();

    }
}

0