結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-26 01:15:55 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 29 ms / 5,000 ms |
| コード長 | 862 bytes |
| コンパイル時間 | 876 ms |
| コンパイル使用メモリ | 111,208 KB |
| 実行使用メモリ | 27,396 KB |
| 最終ジャッジ日時 | 2024-09-16 04:53:39 |
| 合計ジャッジ時間 | 1,996 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / 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.Linq;
class Program
{
const string FULL_HOUSE = "FULL HOUSE";
const string THREE_CARD = "THREE CARD";
const string TWO_PAIR = "TWO PAIR";
const string ONE_PAIR = "ONE PAIR";
const string NO_HAND = "NO HAND";
static void Main(string[] args)
{
var cards = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();
int dbl = 0;
int tri = 0;
var ns = new int[14];
for (int i = 0; i < cards.Count; i++)
{
ns[cards[i]]++;
}
for (int i = 1; i <= 13; i++)
{
if (ns[i] == 2) dbl++;
else if (ns[i] == 3) tri++;
}
if (tri == 1) Console.WriteLine(dbl == 1 ? FULL_HOUSE : THREE_CARD);
else Console.WriteLine( (dbl == 2) ? TWO_PAIR : (dbl == 1) ? ONE_PAIR : NO_HAND);
}
}