結果

問題 No.227 簡単ポーカー
ユーザー TakaTaka
提出日時 2016-04-06 15:01:08
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 981 bytes
コンパイル時間 2,265 ms
コンパイル使用メモリ 77,736 KB
実行使用メモリ 56,160 KB
最終ジャッジ日時 2024-04-14 22:17:53
合計ジャッジ時間 5,044 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
54,088 KB
testcase_01 AC 133 ms
54,228 KB
testcase_02 AC 134 ms
54,312 KB
testcase_03 AC 134 ms
53,984 KB
testcase_04 AC 134 ms
54,196 KB
testcase_05 AC 133 ms
54,172 KB
testcase_06 AC 135 ms
54,240 KB
testcase_07 WA -
testcase_08 AC 134 ms
54,132 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);
		
        int a1 = sc.nextInt();
        int a2 = sc.nextInt();
		int a3 = sc.nextInt();
        int a4 = sc.nextInt();
		int a5 = sc.nextInt();
		
		int num[];
		num = new int[5];
		num[0]=a1;
		num[1]=a2;
		num[2]=a3;
		num[3]=a4;
		num[4]=a5;
		
		int a=0, b=0, c=0, d=0, e=0;
		
		for(int i=0; i<5; i++){
			if(num[0]==num[i]){
				a++;
			}else if(num[1]==num[i]){
				b++;
			}else if(num[2]==num[i]){
				c++;
			}else if(num[3]==num[i]){
				d++;
			}else if(num[4]==num[i]){
				e++;
			}
		}
		if(a==3 && b==2)	System.out.println("FULL HOUSE");
		else if(a==3)	System.out.println("THREE CARD");
		else if(a==2 && b==2)	System.out.println("TWO PAIR");
		else if(a==2)	System.out.println("ONE PAIR");
		else	System.out.println("NO HAND");
    }
}
0