結果

問題 No.227 簡単ポーカー
ユーザー mos_13184925mos_13184925
提出日時 2018-06-18 12:04:36
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 5,000 ms
コード長 813 bytes
コンパイル時間 1,913 ms
コンパイル使用メモリ 71,440 KB
実行使用メモリ 56,436 KB
最終ジャッジ日時 2023-09-13 06:44:17
合計ジャッジ時間 4,456 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
56,072 KB
testcase_01 AC 118 ms
55,904 KB
testcase_02 AC 117 ms
55,948 KB
testcase_03 AC 117 ms
55,972 KB
testcase_04 AC 118 ms
56,224 KB
testcase_05 AC 119 ms
56,064 KB
testcase_06 AC 118 ms
56,304 KB
testcase_07 AC 119 ms
56,280 KB
testcase_08 AC 120 ms
55,956 KB
testcase_09 AC 118 ms
56,428 KB
testcase_10 AC 119 ms
55,992 KB
testcase_11 AC 118 ms
56,436 KB
testcase_12 AC 117 ms
56,212 KB
testcase_13 AC 118 ms
54,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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