結果

問題 No.227 簡単ポーカー
ユーザー cande398cande398
提出日時 2017-10-16 00:35:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 178 ms / 5,000 ms
コード長 675 bytes
コンパイル時間 2,096 ms
コンパイル使用メモリ 74,288 KB
実行使用メモリ 54,264 KB
最終ジャッジ日時 2024-04-28 22:12:46
合計ジャッジ時間 5,103 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
54,244 KB
testcase_01 AC 133 ms
53,868 KB
testcase_02 AC 133 ms
53,980 KB
testcase_03 AC 123 ms
52,556 KB
testcase_04 AC 132 ms
53,780 KB
testcase_05 AC 155 ms
53,484 KB
testcase_06 AC 178 ms
54,084 KB
testcase_07 AC 161 ms
53,896 KB
testcase_08 AC 155 ms
54,080 KB
testcase_09 AC 153 ms
53,824 KB
testcase_10 AC 141 ms
53,748 KB
testcase_11 AC 134 ms
54,264 KB
testcase_12 AC 134 ms
53,860 KB
testcase_13 AC 137 ms
53,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int i, three = 0, two = 0;
        int[] count = new int[14];
        for(i=0;i<5;i++){
            count[sc.nextInt()]++;
        }
        for(i=1;i<14;i++){
            if(count[i] == 2)two++;
            if(count[i] == 3)three++;
        }
        if(two == 1 && three == 1)System.out.println("FULL HOUSE");
        else if(three == 1)System.out.println("THREE CARD");
        else if(two == 2)System.out.println("TWO PAIR");
        else if(two == 1)System.out.println("ONE PAIR");
        else System.out.println("NO HAND");
    }
}
0