結果

問題 No.227 簡単ポーカー
ユーザー omc-test
提出日時 2016-08-03 15:53:53
言語 Java
(openjdk 23)
結果
AC  
実行時間 135 ms / 5,000 ms
コード長 469 bytes
コンパイル時間 2,049 ms
コンパイル使用メモリ 74,272 KB
実行使用メモリ 41,380 KB
最終ジャッジ日時 2024-11-06 23:43:42
合計ジャッジ時間 4,651 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count[] = new int[13];
		for(int i=0; i<5; i++){
			count[sc.nextInt()-1]++;
		}
		sc.close();
		String yaku[] = {"NO HAND", "ONE PAIR", "TWO PAIR", "THREE CARD", "FULL HOUSE"};

		int no = 0;
		for(int i=0; i<13; i++){
			if(count[i] == 2){
				no++;
			}
			if(count[i] == 3){
				no+=3;
			}
		}
		System.out.println(yaku[no]);
	}
}
0