結果

問題 No.227 簡単ポーカー
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-09 17:18:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 5,000 ms
コード長 657 bytes
コンパイル時間 2,177 ms
コンパイル使用メモリ 75,024 KB
実行使用メモリ 41,780 KB
最終ジャッジ日時 2024-04-16 17:49:54
合計ジャッジ時間 4,768 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
41,292 KB
testcase_01 AC 133 ms
41,224 KB
testcase_02 AC 135 ms
41,228 KB
testcase_03 AC 135 ms
41,236 KB
testcase_04 AC 135 ms
41,260 KB
testcase_05 AC 134 ms
41,176 KB
testcase_06 AC 134 ms
41,348 KB
testcase_07 AC 134 ms
41,460 KB
testcase_08 AC 134 ms
41,220 KB
testcase_09 AC 135 ms
41,364 KB
testcase_10 AC 132 ms
41,780 KB
testcase_11 AC 133 ms
41,272 KB
testcase_12 AC 137 ms
41,368 KB
testcase_13 AC 136 ms
41,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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