結果
問題 | No.227 簡単ポーカー |
ユーザー | mobius_bkst |
提出日時 | 2015-06-19 22:29:55 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 46 ms / 5,000 ms |
コード長 | 1,514 bytes |
コンパイル時間 | 3,723 ms |
コンパイル使用メモリ | 88,276 KB |
実行使用メモリ | 49,828 KB |
最終ジャッジ日時 | 2023-09-21 09:57:43 |
合計ジャッジ時間 | 5,185 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 44 ms
49,288 KB |
testcase_01 | AC | 43 ms
49,828 KB |
testcase_02 | AC | 45 ms
49,296 KB |
testcase_03 | AC | 44 ms
49,336 KB |
testcase_04 | AC | 45 ms
49,300 KB |
testcase_05 | AC | 45 ms
49,304 KB |
testcase_06 | AC | 46 ms
49,348 KB |
testcase_07 | AC | 45 ms
49,744 KB |
testcase_08 | AC | 44 ms
49,592 KB |
testcase_09 | AC | 45 ms
49,536 KB |
testcase_10 | AC | 44 ms
49,332 KB |
testcase_11 | AC | 45 ms
49,224 KB |
testcase_12 | AC | 44 ms
49,336 KB |
testcase_13 | AC | 44 ms
49,432 KB |
ソースコード
import java.io.BufferedReader; import java.io.InputStreamReader; public class No227 { public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new InputStreamReader( System.in)); int[] card = new int[14]; int[] a = strToIntArray(br.readLine()); for (int i : a) { card[i]++; } int three = 0; int two = 0; for (int i : card) { if (i == 3) { three++; } else if (i == 2) { two++; } } 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"); } } catch (Exception e) { e.printStackTrace(); System.err.println("Error:" + e.getMessage()); } } static int[] strToIntArray(String S) { String[] strArray = S.split(" "); int[] intArray = new int[strArray.length]; for (int i = 0; i < strArray.length; i++) { intArray[i] = Integer.parseInt(strArray[i]); } return intArray; } }