結果
問題 | No.227 簡単ポーカー |
ユーザー |
![]() |
提出日時 | 2018-09-26 17:58:20 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 31 ms / 5,000 ms |
コード長 | 806 bytes |
コンパイル時間 | 2,683 ms |
コンパイル使用メモリ | 113,816 KB |
実行使用メモリ | 19,200 KB |
最終ジャッジ日時 | 2024-10-11 19:00:34 |
合計ジャッジ時間 | 4,070 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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.Collections.Generic; using System.Linq; using System; public class Hello { public static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); var a = Array.ConvertAll(line, int.Parse); var d = new Dictionary<int, int>(); for (int i = 0; i < 5; i++) if (d.ContainsKey(a[i])) d[a[i]]++; else d[a[i]] = 1; var b = new List<int>(); foreach (var x in d) b.Add(x.Value); b.Sort(); string ans; if (b[0] == 2 && b[1] == 3) ans = "FULL HOUSE"; else if (b.Count() == 3 && b[2] == 3) ans = "THREE CARD"; else if (b.Count() == 3) ans = "TWO PAIR"; else if (b.Count() == 4) ans = "ONE PAIR"; else ans = "NO HAND"; Console.WriteLine(ans); } }