結果

問題 No.227 簡単ポーカー
ユーザー YukimotoPG
提出日時 2019-02-14 08:53:26
言語 Java
(openjdk 23)
結果
AC  
実行時間 133 ms / 5,000 ms
コード長 654 bytes
コンパイル時間 2,064 ms
コンパイル使用メモリ 74,812 KB
実行使用メモリ 54,180 KB
最終ジャッジ日時 2024-09-13 11:17:35
合計ジャッジ時間 4,815 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		int[] ar = new int[13];
		for (int i=0; i<5; i++) ar[sc.nextInt()-1]++;
		int threeNum = 0;
		int twoNum = 0;
		for (int i=0; i<13; i++) {
			if (ar[i] == 3) threeNum++;
			else if (ar[i] == 2) twoNum++;
		}
		if (threeNum==1 && twoNum==1) System.out.println("FULL HOUSE");
		else if (threeNum==1 && twoNum==0) System.out.println("THREE CARD");
		else if (threeNum==0 && twoNum==2) System.out.println("TWO PAIR");
		else if (threeNum==0 && twoNum==1) System.out.println("ONE PAIR");
		else System.out.println("NO HAND");
		
	}
}
0