結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
ooh_21
|
| 提出日時 | 2017-06-01 10:50:02 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,827 bytes |
| コンパイル時間 | 937 ms |
| コンパイル使用メモリ | 114,500 KB |
| 実行使用メモリ | 27,412 KB |
| 最終ジャッジ日時 | 2024-09-21 21:37:00 |
| 合計ジャッジ時間 | 1,985 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 WA * 1 |
コンパイルメッセージ
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 = "THREE PAIR";
}
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