結果

問題 No.227 簡単ポーカー
ユーザー GrenacheGrenache
提出日時 2015-06-19 22:26:15
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 827 bytes
コンパイル時間 3,374 ms
コンパイル使用メモリ 72,752 KB
実行使用メモリ 56,444 KB
最終ジャッジ日時 2023-09-21 09:55:14
合計ジャッジ時間 6,076 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,920 KB
testcase_01 AC 123 ms
56,232 KB
testcase_02 AC 123 ms
56,100 KB
testcase_03 AC 122 ms
56,444 KB
testcase_04 AC 123 ms
56,040 KB
testcase_05 AC 125 ms
55,932 KB
testcase_06 AC 122 ms
56,220 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 123 ms
55,968 KB
testcase_10 AC 125 ms
55,832 KB
testcase_11 AC 126 ms
55,868 KB
testcase_12 RE -
testcase_13 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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


public class Main_yukicoder227 {

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

        int[] cards = new int[13];
        for (int i = 0; i < 5; i++) {
        	int a = sc.nextInt();
        	cards[a]++;
        }
        Arrays.sort(cards);

        if (cards[12] == 3 && cards[11] == 2) {
        	System.out.println("FULL HOUSE");
        } else if (cards[12] == 3 && cards[11] == 1) {
        	System.out.println("THREE CARD");
        } else if (cards[12] == 2 && cards[11] == 2) {
        	System.out.println("TWO PAIR");
        } else if (cards[12] == 2 && cards[11] == 1) {
        	System.out.println("ONE PAIR");
        } else {
        	System.out.println("NO HAND");
        }
        
        sc.close();
    }
}
0