結果

問題 No.227 簡単ポーカー
ユーザー キョウチク
提出日時 2022-05-17 20:26:34
言語 Java
(openjdk 23)
結果
AC  
実行時間 127 ms / 5,000 ms
コード長 697 bytes
コンパイル時間 4,242 ms
コンパイル使用メモリ 74,904 KB
実行使用メモリ 41,416 KB
最終ジャッジ日時 2024-09-15 15:46:41
合計ジャッジ時間 6,495 ms
ジャッジサーバーID
(参考情報)
judge4 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Test11 {
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int n=5;
    String[] line;
    line=sc.nextLine().split(" ");
    int[] cards=new int[14];
    for(int i=0;i<n;i++) cards[Integer.parseInt(line[i])]++;
    Arrays.sort(cards);
    if(cards[12]<2){
      if(cards[13]<2||3<cards[13]){
        System.out.println("NO HAND");
      }else if(cards[13]<3){
        System.out.println("ONE PAIR");
      }else{
        System.out.println("THREE CARD");
      }
    }else{
      if(cards[13]<3){
        System.out.println("TWO PAIR");
      }else{
        System.out.println("FULL HOUSE");
      }
    }
    sc.close();
  }
}
0