結果

問題 No.227 簡単ポーカー
ユーザー abL8ZLsTbFabL8ZLsTbF
提出日時 2016-04-28 17:23:02
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 25 ms / 5,000 ms
コード長 1,074 bytes
コンパイル時間 818 ms
コンパイル使用メモリ 106,624 KB
実行使用メモリ 26,016 KB
最終ジャッジ日時 2024-04-15 05:11:17
合計ジャッジ時間 1,687 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
23,860 KB
testcase_01 AC 23 ms
23,840 KB
testcase_02 AC 25 ms
26,016 KB
testcase_03 AC 24 ms
24,108 KB
testcase_04 AC 25 ms
23,980 KB
testcase_05 AC 24 ms
24,108 KB
testcase_06 AC 25 ms
25,760 KB
testcase_07 AC 24 ms
25,880 KB
testcase_08 AC 24 ms
23,988 KB
testcase_09 AC 24 ms
24,112 KB
testcase_10 AC 24 ms
24,108 KB
testcase_11 AC 24 ms
21,948 KB
testcase_12 AC 24 ms
21,944 KB
testcase_13 AC 25 ms
23,988 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Program
{
    public static void Main()
    {
        int[] cards = Array.ConvertAll(Console.ReadLine().Split(), value => int.Parse(value));
        int[] num = new int[13];
        for (int i = 0; i < 13; i++)
        {
            num[i] = 0;
        }
        bool flag = false;
        foreach (int i in cards)
        {
            num[i-1]++;
        }
        bool threeFlag = false;
        bool pairFlag = false;
        bool twoPairFlag = false;
        foreach (int i in num)
        {
            if (i == 3) threeFlag = true;
            if (i == 2)
            {
                if (pairFlag) twoPairFlag = true;
                else pairFlag = true;
            }
        }
        if (threeFlag)
        {
            if (pairFlag) Console.WriteLine("FULL HOUSE");
            else Console.WriteLine("THREE CARD");
        }
        else if (pairFlag)
        {
            if (twoPairFlag) Console.WriteLine("TWO PAIR");
            else Console.WriteLine("ONE PAIR");
        }
        else Console.WriteLine("NO HAND");
    }
}
0