結果

問題 No.227 簡単ポーカー
ユーザー ginmakuraginmakura
提出日時 2017-10-19 20:57:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 1,089 bytes
コンパイル時間 2,238 ms
コンパイル使用メモリ 74,824 KB
実行使用メモリ 56,240 KB
最終ジャッジ日時 2023-08-13 12:42:48
合計ジャッジ時間 4,994 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,376 KB
testcase_01 AC 122 ms
55,756 KB
testcase_02 AC 123 ms
55,892 KB
testcase_03 AC 119 ms
55,676 KB
testcase_04 AC 120 ms
53,420 KB
testcase_05 AC 117 ms
55,456 KB
testcase_06 AC 120 ms
55,600 KB
testcase_07 AC 124 ms
55,968 KB
testcase_08 AC 123 ms
55,640 KB
testcase_09 AC 121 ms
53,540 KB
testcase_10 AC 112 ms
55,416 KB
testcase_11 AC 118 ms
56,240 KB
testcase_12 AC 123 ms
55,444 KB
testcase_13 AC 119 ms
55,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.lang.Math;

class N227 {
	public static void main(String[] args) throws Exception{
		try (Scanner sc1 = new Scanner(System.in)) {
		
			int[] impnum = new int[5];
			int[] huriwake = new int[13];
			
			int three = 0;
			int two = 0;
			
			// 入力
			impnum[0] = Integer.parseInt(sc1.next());
			impnum[1] = Integer.parseInt(sc1.next());
			impnum[2] = Integer.parseInt(sc1.next());
			impnum[3] = Integer.parseInt(sc1.next());
			impnum[4] = Integer.parseInt(sc1.next());
			
			for(int i = 0;i < 5;i++){
				huriwake[impnum[i] - 1]++;
			}
			
			for(int j = 0;j < 13;j++){
				switch(huriwake[j]){
					case 3:
						three++;
						break;
					case 2:
						two++;
						break;
				}
			}
			
			String result = "NO HAND";
			if(three == 1 && two == 1){
				result = "FULL HOUSE" ;
			}else if(three == 1){
				result = "THREE CARD" ;
			}else if(two == 2){
				result = "TWO PAIR" ;
			}else if(two == 1){
				result = "ONE PAIR" ;
			}
			
			System.out.println(result);
		}
	}
}
0