結果

問題 No.227 簡単ポーカー
ユーザー AoiroFukurouAoiroFukurou
提出日時 2015-09-19 16:03:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 685 bytes
コンパイル時間 3,680 ms
コンパイル使用メモリ 74,148 KB
実行使用メモリ 56,244 KB
最終ジャッジ日時 2023-09-26 13:38:45
合計ジャッジ時間 6,065 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,556 KB
testcase_01 AC 126 ms
55,276 KB
testcase_02 AC 126 ms
55,416 KB
testcase_03 AC 128 ms
55,768 KB
testcase_04 AC 126 ms
55,668 KB
testcase_05 AC 127 ms
55,732 KB
testcase_06 AC 129 ms
55,788 KB
testcase_07 AC 126 ms
56,244 KB
testcase_08 AC 127 ms
55,840 KB
testcase_09 AC 126 ms
55,536 KB
testcase_10 AC 124 ms
55,660 KB
testcase_11 AC 125 ms
55,632 KB
testcase_12 AC 125 ms
55,860 KB
testcase_13 AC 126 ms
55,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package b2015_09_19;

import java.util.Scanner;

public class No227 {
public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int[] C = new int[14];
	int[] A = new int[6];
	for(int i = 1; i<A.length; i++){
		A[i] = sc.nextInt();
	}
	for(int i = 1; i<A.length; i++){
		C[A[i]]++;
	}
	int c1 = 0;
	int c2 = 0;
	for(int i = 1; i<C.length; i++){
		if(C[i]==2){
			c1++;
		}else if(C[i]==3)
			c2++;
	}
	if(c1==1 && c2==1){
		System.out.println("FULL HOUSE");
	}else if(c1==2){
		System.out.println("TWO PAIR");
	}else if(c2==1){
		System.out.println("THREE CARD");
	}else if(c1==1){
		System.out.println("ONE PAIR");
	}else{
		System.out.println("NO HAND");
	}
}
}
0