結果

問題 No.227 簡単ポーカー
コンテスト
ユーザー Tsukasa_Type
提出日時 2018-02-09 17:18:03
言語 Java
(openjdk 27 + 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  
実行時間 55 ms / 5,000 ms
+ 418µs
コード長 657 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,338 ms
コンパイル使用メモリ 85,856 KB
実行使用メモリ 45,188 KB
最終ジャッジ日時 2026-10-11 04:47:55
合計ジャッジ時間 3,251 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

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