結果

問題 No.227 簡単ポーカー
ユーザー curryudon08curryudon08
提出日時 2020-06-18 16:12:09
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 102 ms / 5,000 ms
コード長 1,058 bytes
コンパイル時間 2,870 ms
コンパイル使用メモリ 104,444 KB
実行使用メモリ 23,860 KB
最終ジャッジ日時 2023-09-16 12:10:01
合計ジャッジ時間 4,920 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
23,740 KB
testcase_01 AC 69 ms
21,848 KB
testcase_02 AC 69 ms
23,736 KB
testcase_03 AC 70 ms
21,828 KB
testcase_04 AC 70 ms
21,752 KB
testcase_05 AC 69 ms
21,748 KB
testcase_06 AC 69 ms
23,860 KB
testcase_07 AC 70 ms
21,732 KB
testcase_08 AC 70 ms
23,732 KB
testcase_09 AC 71 ms
21,820 KB
testcase_10 AC 102 ms
19,736 KB
testcase_11 AC 71 ms
21,800 KB
testcase_12 AC 70 ms
21,716 KB
testcase_13 AC 70 ms
21,684 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;

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