結果

問題 No.227 簡単ポーカー
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-14 14:24:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 5,000 ms
コード長 624 bytes
コンパイル時間 2,315 ms
コンパイル使用メモリ 74,336 KB
実行使用メモリ 41,460 KB
最終ジャッジ日時 2024-04-28 19:23:00
合計ジャッジ時間 5,111 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
41,396 KB
testcase_01 AC 137 ms
41,188 KB
testcase_02 AC 136 ms
41,204 KB
testcase_03 AC 135 ms
41,412 KB
testcase_04 AC 137 ms
40,984 KB
testcase_05 AC 137 ms
41,160 KB
testcase_06 AC 134 ms
41,316 KB
testcase_07 AC 118 ms
39,872 KB
testcase_08 AC 134 ms
41,460 KB
testcase_09 AC 120 ms
39,972 KB
testcase_10 AC 137 ms
41,080 KB
testcase_11 AC 137 ms
41,360 KB
testcase_12 AC 136 ms
41,396 KB
testcase_13 AC 136 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[] a = new int[14];
		for(int i = 0 ; i < 5 ; i++) {
			int p = sc.nextInt();
			a[p]++;
		}
		int t = 0, p = 0;
		for(int i = 0 ; i < 14 ; i++) {
			if(a[i] == 3) t++;
			else if(a[i] == 2) p++;
		}
		if(t == 1 && p == 1) {
			System.out.println("FULL HOUSE");
		} else if(t == 1) {
			System.out.println("THREE CARD");
		} else if(p == 2) {
			System.out.println("TWO PAIR");
		} else if(p == 1) {
			System.out.println("ONE PAIR");
		} else {
			System.out.println("NO HAND");
		}
 	}
}
0