結果
問題 |
No.227 簡単ポーカー
|
ユーザー |
![]() |
提出日時 | 2020-12-12 08:14:45 |
言語 | Go (1.23.4) |
結果 |
WA
|
実行時間 | - |
コード長 | 664 bytes |
コンパイル時間 | 12,227 ms |
コンパイル使用メモリ | 236,308 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-19 21:46:02 |
合計ジャッジ時間 | 11,346 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 WA * 4 |
ソースコード
package main import ( "fmt" "strconv" "strings" ) func main() { s := make([]string, 5) for i := range s { fmt.Scan(&s[i]) } hand := strings.Join(s, "") pair := 0 triplet := 0 for i := 0; i < 13; i++ { j := strconv.Itoa(i + 1) if strings.Count(hand, j) != 3 && strings.Count(hand, j) == 2 { pair++ } else if strings.Count(hand, j) == 3 { triplet++ } } if pair == 1 && triplet == 1 { fmt.Println("FULL HOUSE") } else if pair == 0 && triplet == 1 { fmt.Println("THREE CARD") } else if pair == 2 { fmt.Println("TWO PAIR") } else if pair == 1 && triplet == 0 { fmt.Println("ONE PAIR") } else { fmt.Println("NO HAND") } }