結果

問題 No.227 簡単ポーカー
ユーザー A_rinataroA_rinataro
提出日時 2015-09-19 16:17:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 553 bytes
コンパイル時間 2,131 ms
コンパイル使用メモリ 72,020 KB
実行使用メモリ 56,312 KB
最終ジャッジ日時 2023-09-26 13:39:10
合計ジャッジ時間 4,655 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,560 KB
testcase_01 AC 121 ms
56,096 KB
testcase_02 AC 119 ms
56,012 KB
testcase_03 AC 123 ms
55,704 KB
testcase_04 AC 123 ms
56,312 KB
testcase_05 AC 119 ms
55,568 KB
testcase_06 AC 118 ms
55,932 KB
testcase_07 AC 122 ms
55,984 KB
testcase_08 AC 120 ms
55,860 KB
testcase_09 AC 118 ms
55,560 KB
testcase_10 AC 119 ms
55,748 KB
testcase_11 AC 123 ms
55,704 KB
testcase_12 AC 120 ms
55,952 KB
testcase_13 AC 122 ms
56,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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