結果

問題 No.227 簡単ポーカー
ユーザー yun_appyun_app
提出日時 2016-05-12 00:38:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 57 ms / 5,000 ms
コード長 1,146 bytes
コンパイル時間 2,086 ms
コンパイル使用メモリ 77,812 KB
実行使用メモリ 50,544 KB
最終ジャッジ日時 2024-04-15 15:15:47
合計ジャッジ時間 3,578 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
49,944 KB
testcase_01 AC 56 ms
50,128 KB
testcase_02 AC 55 ms
50,308 KB
testcase_03 AC 57 ms
50,544 KB
testcase_04 AC 56 ms
50,484 KB
testcase_05 AC 55 ms
50,136 KB
testcase_06 AC 55 ms
50,000 KB
testcase_07 AC 55 ms
50,200 KB
testcase_08 AC 55 ms
50,328 KB
testcase_09 AC 56 ms
50,488 KB
testcase_10 AC 56 ms
50,192 KB
testcase_11 AC 55 ms
50,344 KB
testcase_12 AC 57 ms
50,368 KB
testcase_13 AC 56 ms
50,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.lang.*;
import java.io.*;

class Ideone{
    public static void main(String[] args) throws Exception{
        // your code goes here
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] lines = br.readLine().split(" ");
        int[] cards = new int[13];
        cards[Integer.parseInt(lines[0])-1]++;
        cards[Integer.parseInt(lines[1])-1]++;
        cards[Integer.parseInt(lines[2])-1]++;
        cards[Integer.parseInt(lines[3])-1]++;
        cards[Integer.parseInt(lines[4])-1]++;
        
        int two = 0;
        int three = 0;
        for(int n:cards){
            if(n==2){
                two++;
            }else if(n==3){
                three++;
            }
        }
        if(three==1 && two==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