結果

問題 No.227 簡単ポーカー
ユーザー kou6839kou6839
提出日時 2015-06-20 01:04:18
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,175 bytes
コンパイル時間 1,990 ms
コンパイル使用メモリ 74,512 KB
実行使用メモリ 58,576 KB
最終ジャッジ日時 2023-09-21 10:27:52
合計ジャッジ時間 4,429 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 115 ms
55,612 KB
testcase_02 AC 115 ms
56,100 KB
testcase_03 AC 117 ms
55,620 KB
testcase_04 AC 118 ms
56,104 KB
testcase_05 AC 116 ms
55,840 KB
testcase_06 WA -
testcase_07 AC 116 ms
56,044 KB
testcase_08 WA -
testcase_09 AC 116 ms
55,920 KB
testcase_10 AC 117 ms
56,176 KB
testcase_11 AC 116 ms
55,984 KB
testcase_12 AC 115 ms
55,852 KB
testcase_13 AC 113 ms
55,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;



public class Main {
    public static void main(String[] args){
        // TODO 自動生成されたメソッド・スタブ
    	Scanner sc = new Scanner(System.in);
    	int[] hand = new int[5];
    	for(int i=0;i<5;i++) hand[i]=sc.nextInt();
    	Arrays.sort(hand);
    	if(hand[0]==hand[1]&&hand[1]==hand[2] && hand[3]==hand[4] &&hand[0]!=hand[3]|| hand[0]==hand[1] && hand[2]==hand[3] &&hand[3]==hand[4]&&hand[0]!=hand[3]){
    		System.out.println("FULL HOUSE");
    		return;
    	}
    	if(hand[0]==hand[1] && hand[1]==hand[2] &&hand[0]!=hand[3] && hand[0]!=hand[4]|| hand[4]==hand[3] && hand[3]==hand[2]&&hand[4]!=hand[1]&&hand[4]!=hand[0]){
    		System.out.println("THREE CARD");
    		return;
    	}
    	if(hand[0]==hand[1] && hand[2]==hand[3] || hand[0]==hand[1]&&hand[3]==hand[4]||hand[1]==hand[2]&&hand[3]==hand[4]){
    		System.out.println("TWO PAIR");
    		return;
    	}
    	if(hand[0]==hand[1] || hand[1]==hand[2] || hand[2]==hand[3]||hand[3]==hand[4]){
    		System.out.println("ONE PAIR");
    		return;
    	}
    	System.out.println("NO HAND");
    }
}
0