結果

問題 No.227 簡単ポーカー
ユーザー キョウチクキョウチク
提出日時 2022-05-17 20:26:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 697 bytes
コンパイル時間 5,797 ms
コンパイル使用メモリ 73,216 KB
実行使用メモリ 55,968 KB
最終ジャッジ日時 2023-10-13 20:03:21
合計ジャッジ時間 8,573 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,448 KB
testcase_01 AC 126 ms
55,864 KB
testcase_02 AC 127 ms
55,656 KB
testcase_03 AC 126 ms
55,648 KB
testcase_04 AC 125 ms
55,912 KB
testcase_05 AC 129 ms
55,836 KB
testcase_06 AC 129 ms
55,732 KB
testcase_07 AC 128 ms
53,748 KB
testcase_08 AC 126 ms
55,716 KB
testcase_09 AC 126 ms
55,652 KB
testcase_10 AC 130 ms
55,792 KB
testcase_11 AC 126 ms
54,116 KB
testcase_12 AC 129 ms
55,708 KB
testcase_13 AC 131 ms
55,968 KB
権限があれば一括ダウンロードができます

ソースコード

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