結果

問題 No.227 簡単ポーカー
ユーザー ぴろずぴろず
提出日時 2015-06-19 22:22:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 118 ms / 5,000 ms
コード長 620 bytes
コンパイル時間 1,847 ms
コンパイル使用メモリ 71,808 KB
実行使用メモリ 56,144 KB
最終ジャッジ日時 2023-09-21 09:51:57
合計ジャッジ時間 4,228 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
55,972 KB
testcase_01 AC 116 ms
55,936 KB
testcase_02 AC 113 ms
55,768 KB
testcase_03 AC 111 ms
55,800 KB
testcase_04 AC 116 ms
55,932 KB
testcase_05 AC 113 ms
55,672 KB
testcase_06 AC 111 ms
55,572 KB
testcase_07 AC 113 ms
56,144 KB
testcase_08 AC 113 ms
56,036 KB
testcase_09 AC 115 ms
55,752 KB
testcase_10 AC 118 ms
55,936 KB
testcase_11 AC 117 ms
56,036 KB
testcase_12 AC 117 ms
56,068 KB
testcase_13 AC 117 ms
55,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no227;

import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] count = new int[14];
		for(int i=0;i<5;i++) {
			count[sc.nextInt()]++;
		}
		Arrays.sort(count);
		if (count[13] == 3 && count[12] == 2) {
			System.out.println("FULL HOUSE");
		}else if(count[13] == 3) {
			System.out.println("THREE CARD");
		}else if(count[13] == 2 && count[12] == 2) {
			System.out.println("TWO PAIR");
		}else if(count[13] == 2) {
			System.out.println("ONE PAIR");
		}else{
			System.out.println("NO HAND");
		}
	}

}
0