結果

問題 No.227 簡単ポーカー
ユーザー yuki2006yuki2006
提出日時 2015-06-19 21:59:31
言語 Go
(1.22.1)
結果
RE  
実行時間 -
コード長 875 bytes
コンパイル時間 10,943 ms
コンパイル使用メモリ 238,416 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-19 02:25:40
合計ジャッジ時間 11,785 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
)
import (
	"bufio"
	"os"
	"strconv"
)

func solve() string {
	var Count [14]int
	for i := 0; i < 5; i++ {
		Count[nextInt()]++
	}
	var same [5]int
	for i := 1; i <= 13; i++ {
		same[Count[i]]++
	}
	if same[3] == 1 && same[2] == 1 {
		return "FULL HOUSE"
	}else if same[3] == 1 {
		return "THREE CARD"
	}else if same[2] == 2 {
		return "TWO PAIR"
	}else if same[2] == 1 {
		return "ONE PAIR"
	}
	return "NO HAND"

}
func main() {
	fmt.Print(solve())
}

var s = bufio.NewScanner(os.Stdin)

func next() string {
	s.Split(bufio.ScanWords)
	s.Scan()
	return s.Text()
}
func nextLine() string {
	s.Split(bufio.ScanLines)
	s.Scan()
	return s.Text()
}

func nextInt() int {
	i, e := strconv.Atoi(next())
	if e != nil {
		panic(e)
	}
	return i
}
func nextLong() int64 {
	i, e := strconv.ParseInt(next(), 10, 64)
	if e != nil {
		panic(e)
	}
	return i
}
0