結果

問題 No.227 簡単ポーカー
コンテスト
ユーザー Tsukasa_Type
提出日時 2018-02-09 17:18:03
言語 Java
(openjdk 27.0.1.0.3 + ACL)
コンパイル:
javac -J-Duser.language=en -encoding UTF8 -cp /opt/aclib/ac_library.jar _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true -cp .:/opt/aclib/ac_library.jar _class_
結果
AC  
実行時間 151 ms / 5,000 ms
+ 828µs
コード長 657 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,840 ms
コンパイル使用メモリ 91,352 KB
実行使用メモリ 48,672 KB
最終ジャッジ日時 2026-11-12 00:18:40
合計ジャッジ時間 6,057 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int[] ar = new int[14];
		for (int i=0; i<5; i++) {
			ar[sc.nextInt()]++;
		}
		
		int triple = 0;
		int pair = 0;
		
		for (int i=0; i<14; i++) {
			if (ar[i]==2) {pair++;}
			else if (ar[i]==3) {triple++;}
		}
		
		if (triple==1 && pair==1) {System.out.println("FULL HOUSE");}
		else if (triple==1 && pair==0) {System.out.println("THREE CARD");}
		else if (triple==0 && pair==2) {System.out.println("TWO PAIR");}
		else if (triple==0 && pair==1) {System.out.println("ONE PAIR");}
		else {System.out.println("NO HAND");}
	}
}
0