結果

問題 No.227 簡単ポーカー
ユーザー sasakkisasakki
提出日時 2016-03-22 10:29:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 5,000 ms
コード長 744 bytes
コンパイル時間 2,360 ms
コンパイル使用メモリ 75,296 KB
実行使用メモリ 58,216 KB
最終ジャッジ日時 2024-04-08 21:49:27
合計ジャッジ時間 4,986 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
57,832 KB
testcase_01 AC 139 ms
57,716 KB
testcase_02 AC 138 ms
57,828 KB
testcase_03 AC 137 ms
56,028 KB
testcase_04 AC 136 ms
57,972 KB
testcase_05 AC 140 ms
57,972 KB
testcase_06 AC 139 ms
57,696 KB
testcase_07 AC 140 ms
57,704 KB
testcase_08 AC 136 ms
57,972 KB
testcase_09 AC 139 ms
58,216 KB
testcase_10 AC 141 ms
57,684 KB
testcase_11 AC 139 ms
57,956 KB
testcase_12 AC 140 ms
57,812 KB
testcase_13 AC 139 ms
57,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.Arrays;

class main{
    public static void main(String args[]){
	Scanner scan = new Scanner(System.in);

	int card[] = new int[13];

	Arrays.fill(card, 0);

	for(int i = 0; i < 5; i++){
	    int num = scan.nextInt();

	    card[num - 1]++;
	}
	
	int thf = 0;
	int twf = 0;

	for(int i = 0; i < 13; i++){
	    if(card[i] == 3){
		thf++;
	    }
	    else if(card[i] == 2){
		twf++;
	    }
	}

	if(thf == 1 && twf == 1){
	    System.out.println("FULL HOUSE");
	}
	else if(thf == 1){
	    System.out.println("THREE CARD");
	}
	else if(twf == 2){
	    System.out.println("TWO PAIR");
	}
	else if(twf == 1){
	    System.out.println("ONE PAIR");
	}
	else{
	    System.out.println("NO HAND");
	}
	
	
    }
}
0