結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-03-28 01:07:34 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 38 ms / 5,000 ms |
| コード長 | 848 bytes |
| コンパイル時間 | 1,039 ms |
| コンパイル使用メモリ | 113,836 KB |
| 実行使用メモリ | 28,156 KB |
| 最終ジャッジ日時 | 2025-01-02 10:21:07 |
| 合計ジャッジ時間 | 2,286 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
public class P0227 {
public static void Main() {
var a = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToList();
var dict = new Dictionary<int, int>();
foreach(int i in a) {
dict[i] = dict.GetValueOrDefault(i) + 1;
}
if(dict.Count() == 2 && dict.Values.Max() == 3) {
Console.WriteLine("FULL HOUSE");
} else if(dict.Count() == 3 && dict.Values.Max() == 3) {
Console.WriteLine("THREE CARD");
} else if(dict.Count() == 3 && dict.Values.Max() == 2) {
Console.WriteLine("TWO PAIR");
} else if(dict.Count() == 4 && dict.Values.Max() == 2) {
Console.WriteLine("ONE PAIR");
} else {
Console.WriteLine("NO HAND");
}
}
}