結果

問題 No.227 簡単ポーカー
コンテスト
ユーザー yun_app
提出日時 2016-05-12 00:38:58
言語 Java
(openjdk 27 + ACL)
コンパイル:
javac -J-Duser.language=en -encoding UTF8 -cp /opt/aclib/ac_library.jar _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true -cp .:/opt/aclib/ac_library.jar _class_
結果
AC  
実行時間 30 ms / 5,000 ms
+ 798µs
コード長 1,146 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,758 ms
コンパイル使用メモリ 86,576 KB
実行使用メモリ 43,500 KB
最終ジャッジ日時 2026-10-11 03:05:03
合計ジャッジ時間 3,291 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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