結果

問題 No.227 簡単ポーカー
ユーザー 8130Tsk8130Tsk
提出日時 2015-08-08 01:38:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 708 bytes
コンパイル時間 3,273 ms
コンパイル使用メモリ 71,656 KB
実行使用メモリ 56,188 KB
最終ジャッジ日時 2023-09-25 06:38:17
合計ジャッジ時間 5,904 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
56,012 KB
testcase_01 AC 125 ms
55,816 KB
testcase_02 AC 128 ms
56,148 KB
testcase_03 AC 126 ms
55,992 KB
testcase_04 AC 126 ms
55,636 KB
testcase_05 AC 125 ms
55,732 KB
testcase_06 AC 125 ms
55,828 KB
testcase_07 AC 124 ms
55,608 KB
testcase_08 AC 125 ms
55,836 KB
testcase_09 AC 124 ms
55,392 KB
testcase_10 AC 126 ms
55,900 KB
testcase_11 AC 127 ms
55,452 KB
testcase_12 AC 125 ms
55,392 KB
testcase_13 AC 127 ms
56,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No227 {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int a[] = new int[5];
		for(int i=0; i<5; i++){
			a[i] = sc.nextInt();
		}
		
		int[] cards = new int[14];
		
		for(int i : a ){
			cards[i]++;
		}
		
		int three = 0;
		int two = 0;
		
		for(int i : cards ){
			if(i==3){
				three++;
			}else if(i==2){
				two++;
			}
			
		}
		
		if(three==1 && two==1 ){
			System.out.println("FULL HOUSE");
		}else if(three==1){
			System.out.println("THREE CARD");
		}else if(two==2){
			System.out.println("TWO PAIR");
		}else if(two==1){
			System.out.println("ONE PAIR");			
		}else{
			System.out.println("NO HAND");				
		}

	}

}
0