結果

問題 No.227 簡単ポーカー
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-14 08:53:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 654 bytes
コンパイル時間 1,833 ms
コンパイル使用メモリ 71,756 KB
実行使用メモリ 56,220 KB
最終ジャッジ日時 2023-10-11 12:30:14
合計ジャッジ時間 4,391 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,856 KB
testcase_01 AC 119 ms
56,152 KB
testcase_02 AC 120 ms
56,056 KB
testcase_03 AC 122 ms
55,868 KB
testcase_04 AC 121 ms
56,132 KB
testcase_05 AC 120 ms
56,028 KB
testcase_06 AC 121 ms
56,068 KB
testcase_07 AC 121 ms
56,220 KB
testcase_08 AC 121 ms
55,848 KB
testcase_09 AC 126 ms
55,712 KB
testcase_10 AC 121 ms
55,696 KB
testcase_11 AC 124 ms
55,572 KB
testcase_12 AC 119 ms
56,196 KB
testcase_13 AC 120 ms
55,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		int[] ar = new int[13];
		for (int i=0; i<5; i++) ar[sc.nextInt()-1]++;
		int threeNum = 0;
		int twoNum = 0;
		for (int i=0; i<13; i++) {
			if (ar[i] == 3) threeNum++;
			else if (ar[i] == 2) twoNum++;
		}
		if (threeNum==1 && twoNum==1) System.out.println("FULL HOUSE");
		else if (threeNum==1 && twoNum==0) System.out.println("THREE CARD");
		else if (threeNum==0 && twoNum==2) System.out.println("TWO PAIR");
		else if (threeNum==0 && twoNum==1) System.out.println("ONE PAIR");
		else System.out.println("NO HAND");
		
	}
}
0