結果
問題 | No.227 簡単ポーカー |
ユーザー | t8m8⛄️ |
提出日時 | 2015-08-03 19:56:01 |
言語 | Java19 (openjdk 21) |
結果 |
AC
|
実行時間 | 126 ms / 5,000 ms |
コード長 | 1,439 bytes |
コンパイル時間 | 3,560 ms |
コンパイル使用メモリ | 75,548 KB |
実行使用メモリ | 56,592 KB |
最終ジャッジ日時 | 2023-09-25 00:54:17 |
合計ジャッジ時間 | 6,332 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 123 ms
54,264 KB |
testcase_01 | AC | 121 ms
56,060 KB |
testcase_02 | AC | 121 ms
55,804 KB |
testcase_03 | AC | 125 ms
56,112 KB |
testcase_04 | AC | 123 ms
55,708 KB |
testcase_05 | AC | 125 ms
56,592 KB |
testcase_06 | AC | 125 ms
56,024 KB |
testcase_07 | AC | 122 ms
55,872 KB |
testcase_08 | AC | 123 ms
56,160 KB |
testcase_09 | AC | 126 ms
56,388 KB |
testcase_10 | AC | 125 ms
55,732 KB |
testcase_11 | AC | 123 ms
56,100 KB |
testcase_12 | AC | 122 ms
56,272 KB |
testcase_13 | AC | 120 ms
56,204 KB |
ソースコード
import java.util.*; import java.io.*; import java.awt.geom.*; import java.math.*; public class No0227 { static final Scanner in = new Scanner(System.in); static final PrintWriter out = new PrintWriter(System.out,false); static void solve() { int[] a = new int[5]; for (int i=0; i<5; i++) { a[i] = in.nextInt(); } Arrays.sort(a); if ((a[0] == a[1] && a[1] == a[2] && a[2] == a[3] && a[3] == a[4]) || (a[1] == a[2] && a[2] == a[3] && a[3] == a[4]) || (a[0] == a[1] && a[1] == a[2] && a[2] == a[3])) { out.println("NO HAND"); }else if ((a[0] == a[1] && a[1] == a[2] && a[3] == a[4]) || a[0] == a[1] && a[2] == a[3] && a[3] == a[4]) { out.println("FULL HOUSE"); }else if ((a[0] == a[1] && a[1] == a[2]) || (a[1] == a[2] && a[2] == a[3]) || (a[2] == a[3] && a[3] == a[4])) { out.println("THREE CARD"); }else if ((a[0] == a[1] && a[2] == a[3]) || (a[0] == a[1] && a[3] == a[4]) || (a[1] == a[2] && a[3] == a[4])) { out.println("TWO PAIR"); }else if (a[0] == a[1] || a[1] == a[2] || a[2] == a[3] || a[3] == a[4]) { out.println("ONE PAIR"); }else { out.println("NO HAND"); } } public static void main(String[] args) { long start = System.currentTimeMillis(); solve(); out.flush(); long end = System.currentTimeMillis(); //trace(end-start + "ms"); in.close(); out.close(); } static void trace(Object... o) { System.out.println(Arrays.deepToString(o));} }