結果

問題 No.227 簡単ポーカー
ユーザー swdamdr
提出日時 2017-02-15 16:11:05
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 943 bytes
コンパイル時間 3,450 ms
コンパイル使用メモリ 117,640 KB
実行使用メモリ 29,332 KB
最終ジャッジ日時 2024-12-29 23:05:21
合計ジャッジ時間 3,817 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 RE * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
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[] card = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
        string ans = "NO HAND";

        int[] ary = Console.ReadLine().Split().Select(int.Parse).ToArray();


        for (int i = 0; i < ary.Length; i++)
        {
            card[ary[i]]++;
        }

        Array.Sort(card);

        if (card[12] == 3)
        {
            if (card[11] == 2)
            {
                ans = "FULL HOUSE";
            }
            else
            {
                ans = "THREE CARD";
            }
        }
        else if (card[12] == 2)
        {
            if (card[11] == 2)
            {
                ans = "TWO PAIR";
            }
            else
            {
                ans = "ONE PAIR";
            }
        }

        Console.WriteLine(ans);
        Console.Read();
    }
}
0