結果

問題 No.227 簡単ポーカー
ユーザー nCk_cvnCk_cv
提出日時 2015-08-05 01:24:36
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 777 bytes
コンパイル時間 1,974 ms
コンパイル使用メモリ 73,728 KB
実行使用メモリ 56,568 KB
最終ジャッジ日時 2023-09-25 01:12:19
合計ジャッジ時間 4,636 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,684 KB
testcase_01 AC 121 ms
55,764 KB
testcase_02 AC 124 ms
55,612 KB
testcase_03 AC 121 ms
55,500 KB
testcase_04 AC 121 ms
55,876 KB
testcase_05 AC 121 ms
55,624 KB
testcase_06 AC 120 ms
55,512 KB
testcase_07 AC 119 ms
55,784 KB
testcase_08 AC 124 ms
56,568 KB
testcase_09 AC 122 ms
55,748 KB
testcase_10 AC 123 ms
56,104 KB
testcase_11 AC 126 ms
55,540 KB
testcase_12 AC 125 ms
55,728 KB
testcase_13 AC 125 ms
53,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.BigInteger;
import java.util.*;
class Main {

	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] list = new int[5];
		for(int i = 0; i < 5; i++) {
			list[i] = sc.nextInt();
		}
		int[] sum = new int[14];
		for(int i = 0; i < 5; i++) {
			sum[list[i]]++;
		}
		boolean A = false;
		boolean B = false;
		boolean C = false;
		for(int i = 0; i < 14; i++) {
			if(sum[i] == 3) A = true;
			else if(sum[i] == 2 && !B) B = true;
			else if(sum[i] == 2 && B)  C = true;
		}
		
		if(A && B) System.out.println("FULL HOUSE");
		else if(A) System.out.println("THREE CARD");
		else if(B && C) System.out.println("TWO PAIR");
		else if(B) System.out.println("ONE PAIR");
		else System.out.println("NO HAND");
		
		
		
	}

	

	
	
	
}
0