結果

問題 No.227 簡単ポーカー
ユーザー cande398cande398
提出日時 2017-10-16 00:35:46
言語 Java
(openjdk 23)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 675 bytes
コンパイル時間 2,020 ms
コンパイル使用メモリ 74,368 KB
実行使用メモリ 41,444 KB
最終ジャッジ日時 2024-11-17 18:52:39
合計ジャッジ時間 4,506 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

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