結果

問題 No.227 簡単ポーカー
ユーザー shinwisteriashinwisteria
提出日時 2018-02-15 23:33:17
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 833 bytes
コンパイル時間 4,830 ms
コンパイル使用メモリ 73,028 KB
実行使用メモリ 56,844 KB
最終ジャッジ日時 2023-08-28 17:03:04
合計ジャッジ時間 5,731 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 114 ms
55,672 KB
testcase_02 AC 117 ms
55,900 KB
testcase_03 AC 116 ms
55,940 KB
testcase_04 AC 116 ms
56,032 KB
testcase_05 AC 116 ms
55,832 KB
testcase_06 AC 117 ms
55,736 KB
testcase_07 AC 116 ms
55,612 KB
testcase_08 AC 117 ms
55,800 KB
testcase_09 AC 116 ms
55,684 KB
testcase_10 AC 116 ms
55,704 KB
testcase_11 AC 116 ms
56,844 KB
testcase_12 AC 116 ms
56,152 KB
testcase_13 AC 117 ms
55,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package m.shin;
import java.util.HashSet;
import java.util.Scanner;
public class Con227 {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner s = new Scanner(System.in);
		HashSet<Integer> A = new HashSet<>();
		int daburi = 0,count = 0;
		for(int i = 0;i < 5;i++){
			int k = s.nextInt();
			if(A.contains(k)){
				if(daburi == k){
					count++;
				}else{
					daburi = k;
				}
			}else{
				A.add(k);
			}
		}
		s.close();
		switch(A.size()){
		case 2:System.out.println("FULL HOUSE");
		break;
		case 4:System.out.println("ONE PAIR");
		break;
		case 1:System.out.println("NO HAND");
		break;
		case 5:System.out.println("NO HAND");
		break;
		case 3:if(count == 1){
			System.out.println("THREE CARD");
		}else{
			System.out.println("TWO PAIR");
		}
		break;
		}
	}

}
0