結果

問題 No.227 簡単ポーカー
ユーザー GrenacheGrenache
提出日時 2015-06-19 22:27:57
言語 Java21
(openjdk 21)
結果
AC  
実行時間 116 ms / 5,000 ms
コード長 831 bytes
コンパイル時間 2,984 ms
コンパイル使用メモリ 72,360 KB
実行使用メモリ 56,644 KB
最終ジャッジ日時 2023-09-21 09:56:41
合計ジャッジ時間 5,392 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
56,424 KB
testcase_01 AC 116 ms
56,504 KB
testcase_02 AC 112 ms
55,948 KB
testcase_03 AC 110 ms
56,128 KB
testcase_04 AC 110 ms
54,156 KB
testcase_05 AC 110 ms
55,848 KB
testcase_06 AC 114 ms
55,940 KB
testcase_07 AC 110 ms
56,016 KB
testcase_08 AC 111 ms
56,372 KB
testcase_09 AC 114 ms
56,188 KB
testcase_10 AC 114 ms
54,496 KB
testcase_11 AC 114 ms
55,900 KB
testcase_12 AC 112 ms
56,644 KB
testcase_13 AC 113 ms
55,924 KB
権限があれば一括ダウンロードができます

ソースコード

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() - 1;
        	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