結果

問題 No.227 簡単ポーカー
ユーザー omc-testomc-test
提出日時 2016-08-03 15:53:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 469 bytes
コンパイル時間 1,892 ms
コンパイル使用メモリ 74,684 KB
実行使用メモリ 41,396 KB
最終ジャッジ日時 2024-04-24 15:13:34
合計ジャッジ時間 4,316 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
41,288 KB
testcase_01 AC 122 ms
41,132 KB
testcase_02 AC 125 ms
40,996 KB
testcase_03 AC 115 ms
39,948 KB
testcase_04 AC 122 ms
40,936 KB
testcase_05 AC 114 ms
39,980 KB
testcase_06 AC 122 ms
41,344 KB
testcase_07 AC 116 ms
39,964 KB
testcase_08 AC 121 ms
41,204 KB
testcase_09 AC 116 ms
41,396 KB
testcase_10 AC 122 ms
41,120 KB
testcase_11 AC 123 ms
41,100 KB
testcase_12 AC 122 ms
41,132 KB
testcase_13 AC 122 ms
40,976 KB
権限があれば一括ダウンロードができます

ソースコード

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