結果

問題 No.227 簡単ポーカー
ユーザー pirorirori_n712pirorirori_n712
提出日時 2018-07-12 01:02:01
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 30 ms / 5,000 ms
コード長 942 bytes
コンパイル時間 3,397 ms
コンパイル使用メモリ 112,836 KB
実行使用メモリ 25,412 KB
最終ジャッジ日時 2023-10-22 05:07:24
合計ジャッジ時間 2,184 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
25,412 KB
testcase_01 AC 29 ms
25,412 KB
testcase_02 AC 29 ms
25,412 KB
testcase_03 AC 29 ms
25,412 KB
testcase_04 AC 29 ms
25,412 KB
testcase_05 AC 29 ms
25,412 KB
testcase_06 AC 30 ms
25,412 KB
testcase_07 AC 29 ms
25,412 KB
testcase_08 AC 29 ms
25,412 KB
testcase_09 AC 30 ms
25,412 KB
testcase_10 AC 29 ms
25,412 KB
testcase_11 AC 30 ms
25,412 KB
testcase_12 AC 29 ms
25,412 KB
testcase_13 AC 29 ms
25,412 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.Linq;

class No227{
    static void Main(){
        var a=Console.ReadLine().Split(' ').Select(x=>Int32.Parse(x)).ToArray();
        Array.Sort(a);
        var b=0;
        var c=0;
        var d=0;
        for(int i=0;i<4;++i){
            if(a[i]!=a[i+1])
            {
                b++;
                c=(c>1)?c:0;
            }
            else{
                if(d==a[i])c++;
                else c=(c>1)?c:c+1;
            }
            d=a[i];
        }
        string s;
        switch(b){
            case 1:
                if(c==2)s="FULL HOUSE";
                else s="NO HAND";
            break;
            case 2:
                if(c==2)s="THREE CARD";
                else s="TWO PAIR";
            break;
            case 3:
                s="ONE PAIR";
            break;
            default:
                s="NO HAND";
            break;
        }
        Console.WriteLine(s);
    }
}
0