結果

問題 No.227 簡単ポーカー
ユーザー nak2yoshinak2yoshi
提出日時 2016-02-24 11:32:48
言語 D
(dmd 2.107.1)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 413 bytes
コンパイル時間 391 ms
コンパイル使用メモリ 91,088 KB
最終ジャッジ日時 2023-09-02 20:43:26
合計ジャッジ時間 927 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
/dmd2/linux/bin64/../../src/phobos/std/functional.d-mixin-221(221): Error: incompatible types for `(__a) == (__b)`: `SortedRange!(int[], "a < b", SortedRangeOptions.assumeSorted)` and `int[]`
/dmd2/linux/bin64/../../src/phobos/std/algorithm/comparison.d(1954): Error: template instance `std.functional.binaryFun!("a == b", "a", "b").binaryFun!(SortedRange!(int[], "a < b", SortedRangeOptions.assumeSorted), int[])` error instantiating
Main.d(14):        instantiated from here: `predSwitch!("a == b", SortedRange!(int[], "a < b", SortedRangeOptions.assumeSorted), int[], string, int[], string, int[], string, int[], string, string)`

ソースコード

diff #

import std.stdio,
       std.conv,
       std.string,
       std.range,
       std.math,
       std.algorithm;

void main()
{
    auto A = readln.split.to!(int[]);

    int[int] card;
    iota(5).each!(i => card[A[i]]++);
    card.values.sort.predSwitch(
        [2, 3], "FULL HOUSE",
        [1, 1, 3], "THREE CARD",
        [1, 2, 2], "TWO PAIR",
        [1, 1, 1, 2], "ONE PAIR",
        "NO HAND").writeln;
}
0