結果

問題 No.227 簡単ポーカー
ユーザー curryudon08
提出日時 2020-06-18 16:12:09
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 37 ms / 5,000 ms
コード長 1,058 bytes
コンパイル時間 829 ms
コンパイル使用メモリ 114,472 KB
実行使用メモリ 27,860 KB
最終ジャッジ日時 2024-07-03 12:51:28
合計ジャッジ時間 1,939 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

namespace _0227
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();

            var d = new Dictionary<int,int>();
            for(var i = 0; i < s.Length; i++){
                var n = s[i];
                if(d.ContainsKey(n)){
                    d[n] += 1;
                }else{
                    d.Add(n,1);
                }
            }
            var h = string.Join("",d.OrderBy(x => x.Value).Select(x => x.Value.ToString()));

            if(h.Equals("23")){
                Console.WriteLine("FULL HOUSE");
            }else if(h.Equals("113")){
                Console.WriteLine("THREE CARD");
            }else if(h.Equals("122")){
                Console.WriteLine("TWO PAIR");
            }else if(h.Equals("1112")){
                Console.WriteLine("ONE PAIR");
            }else{
                Console.WriteLine("NO HAND");
            }
        }
    }
}
0