結果

問題 No.227 簡単ポーカー
ユーザー ooh_23ooh_23
提出日時 2017-06-01 12:06:36
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 27 ms / 5,000 ms
コード長 1,279 bytes
コンパイル時間 823 ms
コンパイル使用メモリ 110,796 KB
実行使用メモリ 25,252 KB
最終ジャッジ日時 2023-10-21 20:12:40
合計ジャッジ時間 1,854 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
25,252 KB
testcase_01 AC 26 ms
25,252 KB
testcase_02 AC 26 ms
25,252 KB
testcase_03 AC 25 ms
25,252 KB
testcase_04 AC 26 ms
25,252 KB
testcase_05 AC 25 ms
25,252 KB
testcase_06 AC 27 ms
25,252 KB
testcase_07 AC 26 ms
25,252 KB
testcase_08 AC 26 ms
25,252 KB
testcase_09 AC 25 ms
25,252 KB
testcase_10 AC 26 ms
25,252 KB
testcase_11 AC 26 ms
25,252 KB
testcase_12 AC 26 ms
25,252 KB
testcase_13 AC 27 ms
25,252 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 lecture
{
    class Program
    {

        static void Main(string[] args)
        {
            int n = 5;

            int[] syamu = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray();
            int []count  = new int [14];

            for (int i = 1; i <= 13; i++) 
            {
                for (int j = 0; j < n; j++) 
                {
                    if (syamu[j] == i) {
                        count[i]++;
                    }
                }
            }

            int w = 0;
            int t = 0;
            for (int i = 1; i <= 13; i++)
            {
                if (count[i] == 3) 
                {
                    t++;
                }
                else if (count[i] == 2)
                {
                    w++;
                }
            }

            if (t == 1 && w == 1) { Console.WriteLine("FULL HOUSE"); }
            else if (t == 1) { Console.WriteLine("THREE CARD"); }
            else if (w == 2) { Console.WriteLine("TWO PAIR"); }
            else if (w == 1) { Console.WriteLine("ONE PAIR"); }
            else { Console.WriteLine("NO HAND"); }

        }
    }
}
0