結果
問題 | No.227 簡単ポーカー |
ユーザー | miku_minatsuki |
提出日時 | 2019-07-22 03:42:04 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 61 ms / 5,000 ms |
コード長 | 1,442 bytes |
コンパイル時間 | 4,539 ms |
コンパイル使用メモリ | 104,676 KB |
実行使用メモリ | 23,600 KB |
最終ジャッジ日時 | 2023-09-05 14:48:06 |
合計ジャッジ時間 | 5,298 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 59 ms
23,464 KB |
testcase_01 | AC | 59 ms
23,508 KB |
testcase_02 | AC | 59 ms
23,488 KB |
testcase_03 | AC | 60 ms
23,516 KB |
testcase_04 | AC | 61 ms
21,532 KB |
testcase_05 | AC | 59 ms
21,456 KB |
testcase_06 | AC | 60 ms
23,456 KB |
testcase_07 | AC | 59 ms
23,428 KB |
testcase_08 | AC | 60 ms
23,444 KB |
testcase_09 | AC | 60 ms
23,600 KB |
testcase_10 | AC | 60 ms
23,596 KB |
testcase_11 | AC | 59 ms
21,488 KB |
testcase_12 | AC | 61 ms
21,592 KB |
testcase_13 | AC | 59 ms
21,372 KB |
コンパイルメッセージ
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.IO; using System.Linq; public class Program { public static void Main(string[] args) { string result = proc(Console.ReadLine().Split(' ')); Console.WriteLine(result); } private static string proc(string[] args) { List<int> cards = new List<int>(); foreach (string arg in args) { cards.Add(int.Parse(arg)); } List<int> result = Search(cards); string hand = string.Empty; if (result.Contains(3) && result.Contains(2)) { hand = "FULL HOUSE"; } else if (result.Contains(3)) { hand = "THREE CARD"; } else if (result.Count(num => num == 2) == 2) { hand = "TWO PAIR"; } else if (result.Count(num => num == 2) == 1) { hand = "ONE PAIR"; } else { hand = "NO HAND"; } return hand; } private static List<int> Search(List<int> cards) { List<int> result = new List<int>(); for (int i = 1; i <= 13; i++) { int count = 0; foreach (int card in cards) { if (card == i) { count++; } } result.Add(count); } return result; } }