結果
問題 | No.227 簡単ポーカー |
ユーザー |
![]() |
提出日時 | 2018-11-06 01:24:05 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 25 ms / 5,000 ms |
コード長 | 1,140 bytes |
コンパイル時間 | 1,414 ms |
コンパイル使用メモリ | 103,680 KB |
実行使用メモリ | 17,920 KB |
最終ジャッジ日時 | 2024-11-20 20:21:15 |
合計ジャッジ時間 | 2,640 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; class Program { static void Main(string[] args) { //入力 string s = Console.ReadLine(); string[] t = s.Split(' '); int[] A = new int[5]; //数字の割り当て for (int i = 0; i < 5; i++) { A[i] = int.Parse(t[i]); } //カード番号の配列 int[] cards = new int[14]; for (int i = 0; i < 5; i++) { cards[A[i]]++; //それぞれのカード番号が何枚あるか数える } //かぶっている枚数を調べる(値は最大で5まである) int[] ret = new int[6]; for (int i = 0; i <= 13; i++) { ret[cards[i]]++; } if (ret[3] == 1 && ret[2] == 1) { Console.WriteLine("FULL HOUSE"); } else if (ret[3] == 1) { Console.WriteLine("THREE CARD"); } else if (ret[2] == 2) { Console.WriteLine("TWO PAIR"); } else if (ret[2] == 1) { Console.WriteLine("ONE PAIR"); } else { Console.WriteLine("NO HAND"); } } }