結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
nanophoto12
|
| 提出日時 | 2015-12-17 23:44:30 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 945 bytes |
| コンパイル時間 | 992 ms |
| コンパイル使用メモリ | 107,520 KB |
| 実行使用メモリ | 19,328 KB |
| 最終ジャッジ日時 | 2024-09-16 07:45:52 |
| 合計ジャッジ時間 | 1,812 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 WA * 4 |
コンパイルメッセージ
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;
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");
}
}
}
nanophoto12