結果

問題 No.227 簡単ポーカー
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-14 14:24:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 5,000 ms
コード長 624 bytes
コンパイル時間 1,768 ms
コンパイル使用メモリ 71,376 KB
実行使用メモリ 56,488 KB
最終ジャッジ日時 2023-08-11 02:12:45
合計ジャッジ時間 4,413 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,756 KB
testcase_01 AC 116 ms
56,040 KB
testcase_02 AC 116 ms
55,896 KB
testcase_03 AC 117 ms
55,744 KB
testcase_04 AC 116 ms
56,356 KB
testcase_05 AC 119 ms
56,040 KB
testcase_06 AC 116 ms
55,600 KB
testcase_07 AC 114 ms
54,652 KB
testcase_08 AC 114 ms
56,120 KB
testcase_09 AC 113 ms
56,488 KB
testcase_10 AC 113 ms
55,844 KB
testcase_11 AC 115 ms
56,092 KB
testcase_12 AC 117 ms
56,408 KB
testcase_13 AC 115 ms
56,144 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