結果

問題 No.227 簡単ポーカー
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-14 08:52:51
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 616 bytes
コンパイル時間 1,870 ms
コンパイル使用メモリ 71,812 KB
実行使用メモリ 56,572 KB
最終ジャッジ日時 2023-10-11 12:30:09
合計ジャッジ時間 4,599 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 119 ms
55,884 KB
testcase_02 AC 120 ms
55,500 KB
testcase_03 AC 120 ms
55,500 KB
testcase_04 AC 122 ms
55,880 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 124 ms
55,720 KB
testcase_08 WA -
testcase_09 AC 125 ms
55,712 KB
testcase_10 AC 123 ms
55,816 KB
testcase_11 AC 122 ms
56,184 KB
testcase_12 AC 123 ms
55,892 KB
testcase_13 AC 122 ms
54,388 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");
		
	}
}
0