結果

問題 No.227 簡単ポーカー
ユーザー bayashiko_rbayashiko_r
提出日時 2018-11-06 01:24:05
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 58 ms / 5,000 ms
コード長 1,140 bytes
コンパイル時間 2,181 ms
コンパイル使用メモリ 102,808 KB
実行使用メモリ 22,848 KB
最終ジャッジ日時 2023-08-13 03:43:27
合計ジャッジ時間 3,793 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
20,784 KB
testcase_01 AC 56 ms
18,736 KB
testcase_02 AC 56 ms
20,820 KB
testcase_03 AC 56 ms
20,876 KB
testcase_04 AC 56 ms
20,764 KB
testcase_05 AC 56 ms
20,780 KB
testcase_06 AC 56 ms
20,772 KB
testcase_07 AC 57 ms
22,776 KB
testcase_08 AC 58 ms
22,848 KB
testcase_09 AC 57 ms
18,748 KB
testcase_10 AC 57 ms
20,724 KB
testcase_11 AC 57 ms
20,732 KB
testcase_12 AC 56 ms
20,780 KB
testcase_13 AC 57 ms
20,804 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