結果
| 問題 | No.227 簡単ポーカー | 
| コンテスト | |
| ユーザー |  fujita | 
| 提出日時 | 2023-04-28 10:49:14 | 
| 言語 | C# (.NET 8.0.404) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 1,969 bytes | 
| コンパイル時間 | 15,303 ms | 
| コンパイル使用メモリ | 164,436 KB | 
| 実行使用メモリ | 182,744 KB | 
| 最終ジャッジ日時 | 2024-11-17 11:42:04 | 
| 合計ジャッジ時間 | 16,747 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 13 WA * 1 | 
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (101 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System.Collections.Generic;
using System;
using System.Linq;
using System.Drawing;
namespace yukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var A = Console.ReadLine();
            var b = A.Split(" ");
            string[] str = new string[b.Length];
            List<string> Hit = new List<string>();
            List<string> twopair = new List<string>();
            for (int i = 0; i < str.Length; i++)
            {
                str[i] = b[i];
            }
            
            Array.Sort(str);
            
            for(int i = 0; i <= str.Length - 4; i++)
            {
                for (int j = 1 + i; j <= str.Length - 3; j++)
                {
                    if (str[i] == str[j])
                    {
                        Hit.Add(str[i]);
                    }
                }
            }
            for (int i = 2; i <= str.Length - 2; i++)
            {
                for (int j = 2 + i-1; j <= str.Length - 1 ; j++)
                {
                    if (str[i] == str[j])
                    {
                        twopair.Add(str[i]);
                    }
                }
            }
            if (Hit.Count == 3 && twopair.Count == 1 || twopair.Count == 3 && Hit.Count == 1)
            {
                Console.WriteLine("FULL HOUSE");
            }
            else if (Hit.Count == 3 && twopair.Count == 0 || twopair.Count == 3 && Hit.Count == 0)
            {
                Console.WriteLine("THREE CARD");
            }
            else if (Hit.Count == 1 && twopair.Count == 1 )
            {
                Console.WriteLine("TWO PAIR");
            }
            else if (Hit.Count == 1 && twopair.Count == 0 || twopair.Count == 1 && Hit.Count == 0)
            {
                Console.WriteLine("ONE PAIR");
            }
            else
            {
                Console.WriteLine("NO HAND");
            }
        }
    }
}
            
            
            
        