結果
| 問題 | No.227 簡単ポーカー | 
| コンテスト | |
| ユーザー |  8130Tsk | 
| 提出日時 | 2015-08-08 01:38:17 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 133 ms / 5,000 ms | 
| コード長 | 708 bytes | 
| コンパイル時間 | 4,223 ms | 
| コンパイル使用メモリ | 78,064 KB | 
| 実行使用メモリ | 54,288 KB | 
| 最終ジャッジ日時 | 2024-07-18 05:34:20 | 
| 合計ジャッジ時間 | 5,749 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 14 | 
ソースコード
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");				
		}
	}
}
            
            
            
        