結果

問題 No.227 簡単ポーカー
ユーザー 8130Tsk
提出日時 2015-08-08 01:46:07
言語 Java
(openjdk 23)
結果
AC  
実行時間 132 ms / 5,000 ms
コード長 754 bytes
コンパイル時間 3,323 ms
コンパイル使用メモリ 76,380 KB
実行使用メモリ 54,304 KB
最終ジャッジ日時 2024-07-18 05:35:09
合計ジャッジ時間 5,263 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No227 {
	
	public void run(){
		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");				
		}
		
	}
	public static void main(String[] args) {
		new No227().run();
	}

}
0