結果

問題 No.227 簡単ポーカー
ユーザー nanophoto12nanophoto12
提出日時 2015-12-17 23:44:30
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 945 bytes
コンパイル時間 2,433 ms
コンパイル使用メモリ 106,856 KB
実行使用メモリ 23,988 KB
最終ジャッジ日時 2023-10-14 12:58:25
合計ジャッジ時間 3,820 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
21,972 KB
testcase_01 AC 60 ms
21,900 KB
testcase_02 AC 61 ms
21,904 KB
testcase_03 AC 60 ms
23,944 KB
testcase_04 WA -
testcase_05 AC 62 ms
21,864 KB
testcase_06 AC 60 ms
23,964 KB
testcase_07 AC 61 ms
21,852 KB
testcase_08 AC 59 ms
22,048 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 59 ms
21,900 KB
testcase_13 AC 59 ms
21,888 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

namespace No227
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			var cards = Console.ReadLine ().Split (' ').Select (v => Convert.ToInt32 (v)).ToArray ();
			var dictionary = new Dictionary<int, int> ();
			foreach (var element in cards) {
				if (!dictionary.ContainsKey (element)) {
					dictionary.Add (element, 0);
				}
				dictionary [element]++;
			}
			if (dictionary.Any (element => element.Value == 3)) {
				if (dictionary.Any (element => element.Value == 2)) {
					Console.WriteLine ("FULL HOUSE");
					return;
				} 
				Console.WriteLine ("THREE CARD");
				return;
			}
			if (dictionary.Any (element => element.Value == 2)) {
				if (dictionary.Any (element => element.Value == 2)) {
					Console.WriteLine ("TWO PAIR");
					return;
				} 
				Console.WriteLine ("ONE PAIR");
				return;
			}
			Console.WriteLine ("NO HAND");
		}
	}
}
0