結果
| 問題 | No.227 簡単ポーカー | 
| コンテスト | |
| ユーザー |  miku_minatsuki | 
| 提出日時 | 2019-07-21 23:26:59 | 
| 言語 | C#(csc) (csc 3.9.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 1,304 bytes | 
| コンパイル時間 | 869 ms | 
| コンパイル使用メモリ | 106,368 KB | 
| 実行使用メモリ | 24,364 KB | 
| 最終ジャッジ日時 | 2024-06-23 04:49:25 | 
| 合計ジャッジ時間 | 1,860 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 4 WA * 10 | 
コンパイルメッセージ
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 Program
{
    public static void Main(String[] args)
    {
        List<int> cards = new List<int>();
        foreach (string arg in args)
        {
            cards.Add(int.Parse(arg));
        }
        List<int> result = Search(cards);
        if (result.Count(num => num >= 3) == 1 && result.Contains(2))
        {
            Console.WriteLine("FULL HOUSE");
        }
        else if (result.Count(num => num >= 3) == 1)
        {
            Console.WriteLine("THREE CARD");
        }
        else if (result.Count(num => num == 2) == 2)
        {
            Console.WriteLine("TWO PAIR");
        }
        else if (result.Count(num => num == 2) == 1)
        {
            Console.WriteLine("ONE PAIR");
        }
        else
        {
            Console.WriteLine("NO HAND");
        }
    }
    private static List<int> Search(List<int> cards)
    {
        List<int> result = new List<int>();
        for (int i = 1; i <= 13; i++)
        {
            int count = 0;
            foreach (int card in cards)
            {
                if (card == i)
                {
                    count++;
                }
            }
            result.Add(count);
        }
        return result;
    }
}
            
            
            
        