結果

問題 No.227 簡単ポーカー
ユーザー nanophoto12nanophoto12
提出日時 2015-12-17 23:45:44
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 68 ms / 5,000 ms
コード長 922 bytes
コンパイル時間 2,320 ms
コンパイル使用メモリ 106,460 KB
実行使用メモリ 23,940 KB
最終ジャッジ日時 2023-10-14 12:58:42
合計ジャッジ時間 4,086 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
23,800 KB
testcase_01 AC 63 ms
21,752 KB
testcase_02 AC 63 ms
23,808 KB
testcase_03 AC 64 ms
23,940 KB
testcase_04 AC 68 ms
23,856 KB
testcase_05 AC 64 ms
21,908 KB
testcase_06 AC 63 ms
23,824 KB
testcase_07 AC 63 ms
21,860 KB
testcase_08 AC 64 ms
23,812 KB
testcase_09 AC 65 ms
19,840 KB
testcase_10 AC 65 ms
21,780 KB
testcase_11 AC 64 ms
21,956 KB
testcase_12 AC 64 ms
21,908 KB
testcase_13 AC 63 ms
21,788 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.Count() == 3) {
					Console.WriteLine ("TWO PAIR");
					return;
				} 
				Console.WriteLine ("ONE PAIR");
				return;
			}
			Console.WriteLine ("NO HAND");
		}
	}
}
0