結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
ooh_21
|
| 提出日時 | 2017-06-01 10:56:36 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 30 ms / 5,000 ms |
| コード長 | 1,830 bytes |
| コンパイル時間 | 977 ms |
| コンパイル使用メモリ | 108,928 KB |
| 実行使用メモリ | 19,328 KB |
| 最終ジャッジ日時 | 2024-09-21 21:37:21 |
| 合計ジャッジ時間 | 2,030 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace pj8
{
class Program
{
static void Main(string[] args)
{
int[] cards = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray();
Array.Sort(cards);
int excard = cards[0];
int fullcheck = cards[0];
int yaku = 0;
int Ayaku = 0;
String pair = "NO HAND";
bool Acard = false;
bool full = true;
for(int i = 1;i < cards.Length;i++)
{
if(cards[i] == excard)
{
if (Acard == false)
{
yaku++;
}
else
{
Ayaku++;
}
}
else
{
excard = cards[i];
if(yaku > 0)
{
Acard = true;
}
}
}
switch (yaku)
{
case 1:
pair = "ONE PAIR";
if (Ayaku == 2)
{
pair = "FULL HOUSE";
}
else if (Ayaku == 1)
{
pair = "TWO PAIR";
}
break;
case 2:
pair = "THREE CARD";
if (Ayaku == 1)
{
pair = "FULL HOUSE";
}
break;
}
Console.WriteLine(pair);
}
}
}
ooh_21