結果

問題 No.227 簡単ポーカー
コンテスト
ユーザー A_rinataro
提出日時 2015-09-19 16:17:26
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 94 ms / 5,000 ms
コード長 553 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,564 ms
コンパイル使用メモリ 82,100 KB
実行使用メモリ 128,580 KB
最終ジャッジ日時 2026-04-02 15:18:57
合計ジャッジ時間 5,154 ms
ジャッジサーバーID
(参考情報)
judge4_1 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int[] countArray = new int[14];
		for(int i = 0; i<5; i++) {
			int a = scan.nextInt();
			countArray[a] += 1;
		}
		int three = 0;
		int two = 0;
		
		for(int count : countArray) {
			if(count == 3) {
				three++;
			}
			else if(count == 2) {
				two++;
			}
		}
		String[][] hand = {
				{"NO HAND",    "ONE PAIR",  "TWO PAIR"},
				{"THREE CARD", "FULL HOUSE", ""}
		};
		System.out.println(hand[three][two]);
	}
}
0