結果

問題 No.227 簡単ポーカー
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-22 16:35:01
言語 Java21
(openjdk 21)
結果
AC  
実行時間 140 ms / 5,000 ms
コード長 608 bytes
コンパイル時間 2,233 ms
コンパイル使用メモリ 74,416 KB
実行使用メモリ 54,348 KB
最終ジャッジ日時 2024-04-10 10:29:27
合計ジャッジ時間 5,076 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
54,020 KB
testcase_01 AC 134 ms
54,032 KB
testcase_02 AC 134 ms
54,348 KB
testcase_03 AC 136 ms
54,068 KB
testcase_04 AC 134 ms
53,944 KB
testcase_05 AC 135 ms
53,908 KB
testcase_06 AC 134 ms
53,860 KB
testcase_07 AC 134 ms
53,752 KB
testcase_08 AC 133 ms
54,288 KB
testcase_09 AC 136 ms
53,824 KB
testcase_10 AC 138 ms
53,908 KB
testcase_11 AC 140 ms
54,284 KB
testcase_12 AC 133 ms
53,928 KB
testcase_13 AC 133 ms
54,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int[] card = new int[14];
    for(int i = 0; i < 5; i++) {
      card[sc.nextInt()]++;
    }
    int three = 0;
    int two = 0;
    for(int i = 1; i < 14; i++) {
      if(card[i] == 3) three++;
      if(card[i] == 2) two++;
    }
    String ans = "NO HAND";
    if(three == 1 && two == 1) ans = "FULL HOUSE";
    if(three == 1 && two == 0) ans = "THREE CARD";
    if(two == 2) ans = "TWO PAIR";
    if(two == 1 && three == 0) ans = "ONE PAIR";
    System.out.println(ans);
  }
}
0