結果
問題 | No.227 簡単ポーカー |
ユーザー |
![]() |
提出日時 | 2016-05-12 00:38:58 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 68 ms / 5,000 ms |
コード長 | 1,146 bytes |
コンパイル時間 | 2,063 ms |
コンパイル使用メモリ | 77,472 KB |
実行使用メモリ | 50,224 KB |
最終ジャッジ日時 | 2024-10-05 13:52:23 |
合計ジャッジ時間 | 3,538 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
import java.util.*; import java.lang.*; import java.io.*; class Ideone{ public static void main(String[] args) throws Exception{ // your code goes here BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] lines = br.readLine().split(" "); int[] cards = new int[13]; cards[Integer.parseInt(lines[0])-1]++; cards[Integer.parseInt(lines[1])-1]++; cards[Integer.parseInt(lines[2])-1]++; cards[Integer.parseInt(lines[3])-1]++; cards[Integer.parseInt(lines[4])-1]++; int two = 0; int three = 0; for(int n:cards){ if(n==2){ two++; }else if(n==3){ three++; } } 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"); } } }