結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-06 17:18:09 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 860 bytes |
| コンパイル時間 | 2,406 ms |
| コンパイル使用メモリ | 103,752 KB |
| 最終ジャッジ日時 | 2024-11-14 20:11:25 |
| 合計ジャッジ時間 | 2,775 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved. Main.cs(5,26): error CS0103: The name 'Console' does not exist in the current context Main.cs(13,29): error CS1061: 'int[]' does not contain a definition for 'Count' and no accessible extension method 'Count' accepting a first argument of type 'int[]' could be found (are you missing a using directive or an assembly reference?) Main.cs(14,28): error CS1061: 'int[]' does not contain a definition for 'Count' and no accessible extension method 'Count' accepting a first argument of type 'int[]' could be found (are you missing a using directive or an assembly reference?) Main.cs(29,13): error CS0103: The name 'Console' does not exist in the current context
ソースコード
class Program {
static void Main(string[] args) {
string answer;
string[] c = Console.ReadLine().Split(' ');
int[] cnt = new int[13];
for (int i = 0; i < 5; i++) {
cnt[int.Parse(c[i]) - 1]++;
}
int three = cnt.Count(x => x == 3);
int pair = cnt.Count(x => x == 2);
if (three > 0) {
if (pair > 0) {
answer = "FULL HOUSE";
} else {
answer = "THREE CARD";
}
} else {
if (pair == 2) {
answer = "TWO PAIR";
} else if (pair == 1) {
answer = "ONE PAIR";
} else answer = "NO HAND";
}
Console.WriteLine(answer);
}
}