結果

問題 No.227 簡単ポーカー
ユーザー cande398cande398
提出日時 2017-10-16 00:35:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 675 bytes
コンパイル時間 2,013 ms
コンパイル使用メモリ 72,652 KB
実行使用メモリ 55,964 KB
最終ジャッジ日時 2023-08-11 05:22:18
合計ジャッジ時間 4,945 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,696 KB
testcase_01 AC 122 ms
55,964 KB
testcase_02 AC 122 ms
55,768 KB
testcase_03 AC 123 ms
55,960 KB
testcase_04 AC 121 ms
55,456 KB
testcase_05 AC 123 ms
55,860 KB
testcase_06 AC 121 ms
55,788 KB
testcase_07 AC 121 ms
55,624 KB
testcase_08 AC 124 ms
55,464 KB
testcase_09 AC 121 ms
55,940 KB
testcase_10 AC 121 ms
55,800 KB
testcase_11 AC 121 ms
55,692 KB
testcase_12 AC 122 ms
55,860 KB
testcase_13 AC 124 ms
55,740 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