結果

問題 No.227 簡単ポーカー
ユーザー iroganeirogane
提出日時 2019-06-25 17:16:48
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 58 ms / 5,000 ms
コード長 791 bytes
コンパイル時間 2,670 ms
コンパイル使用メモリ 100,072 KB
実行使用メモリ 22,872 KB
最終ジャッジ日時 2023-09-05 06:18:09
合計ジャッジ時間 4,300 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
20,812 KB
testcase_01 AC 57 ms
22,872 KB
testcase_02 AC 58 ms
20,812 KB
testcase_03 AC 57 ms
20,832 KB
testcase_04 AC 57 ms
20,828 KB
testcase_05 AC 57 ms
20,948 KB
testcase_06 AC 56 ms
20,820 KB
testcase_07 AC 58 ms
22,816 KB
testcase_08 AC 57 ms
20,700 KB
testcase_09 AC 57 ms
20,808 KB
testcase_10 AC 57 ms
20,716 KB
testcase_11 AC 56 ms
20,932 KB
testcase_12 AC 56 ms
20,740 KB
testcase_13 AC 57 ms
22,836 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 No227 {
	public static void Main(string[] args) {
	    string[] myHand = Console.ReadLine().Split(" ");
	    int[] handCheck = new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0};
	    
	    for( var i = 0; i < 5; i++ ){
	        handCheck[int.Parse(myHand[i])-1]++;	    
	    }
	    
	    int pair = 0;
	    int three = 0;
	    string hand = "NO HAND";
	    
	    for( var i = 0; i < 13; i++ ){
	        if( handCheck[i] == 2 ){
	            pair++;
	        }
	        if( handCheck[i] == 3 ){
	            three++;
	        }
	    }
	    
        hand = ( three == 1 ) ? "THREE CARD" : hand;
        hand = ( pair == 2 ) ? "TWO PAIR" : hand;
        
	    if( pair == 1 ){
	        hand = ( three == 1 ) ? "FULL HOUSE" : "ONE PAIR";
	    }

	    Console.WriteLine(hand);
	}
}
0