結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
irogane
|
| 提出日時 | 2019-06-25 17:16:48 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 5,000 ms |
| コード長 | 791 bytes |
| コンパイル時間 | 1,723 ms |
| コンパイル使用メモリ | 103,680 KB |
| 実行使用メモリ | 18,048 KB |
| 最終ジャッジ日時 | 2024-06-23 02:40:19 |
| 合計ジャッジ時間 | 3,173 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / 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;
public class No227 {
public static void Main(string[] args) {
string[] myHand = Console.ReadLine().Split(" ");
int[] handCheck = new int[]{0,0,0,0,0,0,0,0,0,0,0,0,0};
for( var i = 0; i < 5; i++ ){
handCheck[int.Parse(myHand[i])-1]++;
}
int pair = 0;
int three = 0;
string hand = "NO HAND";
for( var i = 0; i < 13; i++ ){
if( handCheck[i] == 2 ){
pair++;
}
if( handCheck[i] == 3 ){
three++;
}
}
hand = ( three == 1 ) ? "THREE CARD" : hand;
hand = ( pair == 2 ) ? "TWO PAIR" : hand;
if( pair == 1 ){
hand = ( three == 1 ) ? "FULL HOUSE" : "ONE PAIR";
}
Console.WriteLine(hand);
}
}
irogane