結果

問題 No.227 簡単ポーカー
ユーザー bayashiko_rbayashiko_r
提出日時 2018-11-06 01:24:05
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 23 ms / 5,000 ms
コード長 1,140 bytes
コンパイル時間 3,528 ms
コンパイル使用メモリ 113,100 KB
実行使用メモリ 28,044 KB
最終ジャッジ日時 2024-04-30 22:08:51
合計ジャッジ時間 1,840 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
24,084 KB
testcase_01 AC 20 ms
23,924 KB
testcase_02 AC 21 ms
26,228 KB
testcase_03 AC 21 ms
23,976 KB
testcase_04 AC 21 ms
26,136 KB
testcase_05 AC 21 ms
24,084 KB
testcase_06 AC 21 ms
23,796 KB
testcase_07 AC 22 ms
26,004 KB
testcase_08 AC 22 ms
24,184 KB
testcase_09 AC 23 ms
26,008 KB
testcase_10 AC 23 ms
23,960 KB
testcase_11 AC 21 ms
26,140 KB
testcase_12 AC 22 ms
23,924 KB
testcase_13 AC 21 ms
28,044 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

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");
        }
    }
}
0