結果
問題 |
No.227 簡単ポーカー
|
ユーザー |
![]() |
提出日時 | 2017-06-01 12:06:36 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 29 ms / 5,000 ms |
コード長 | 1,279 bytes |
コンパイル時間 | 1,040 ms |
コンパイル使用メモリ | 114,344 KB |
実行使用メモリ | 19,200 KB |
最終ジャッジ日時 | 2024-09-21 21:38:00 |
合計ジャッジ時間 | 1,740 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; using System.Linq; using System.Text; using System.Threading.Tasks; namespace lecture { class Program { static void Main(string[] args) { int n = 5; int[] syamu = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray(); int []count = new int [14]; for (int i = 1; i <= 13; i++) { for (int j = 0; j < n; j++) { if (syamu[j] == i) { count[i]++; } } } int w = 0; int t = 0; for (int i = 1; i <= 13; i++) { if (count[i] == 3) { t++; } else if (count[i] == 2) { w++; } } if (t == 1 && w == 1) { Console.WriteLine("FULL HOUSE"); } else if (t == 1) { Console.WriteLine("THREE CARD"); } else if (w == 2) { Console.WriteLine("TWO PAIR"); } else if (w == 1) { Console.WriteLine("ONE PAIR"); } else { Console.WriteLine("NO HAND"); } } } }