結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-01-07 10:00:59 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,369 bytes |
| コンパイル時間 | 1,003 ms |
| コンパイル使用メモリ | 109,312 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-12 23:22:23 |
| 合計ジャッジ時間 | 1,481 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 WA * 1 |
ソースコード
import std.stdio : writeln, writefln, readln;
import std.array : array, split;
import std.conv : to;
import std.range.primitives;
import std.range : enumerate, iota, repeat, retro, assumeSorted;
import std.algorithm.searching : all, any, canFind, count, countUntil;
import std.algorithm.comparison : max, min;
import std.algorithm.iteration : each, group, filter, map, reduce, permutations, sum, uniq;
import std.algorithm.sorting : sort;
import std.algorithm.mutation : reverse, swap;
void main() {
auto a = readln.split.to!(int[]).sort().group.array;
if (a.length == 2) {
writeln("FULL HOUSE");
}
else if (a.length == 3) {
writeln(a.canFind!"a[1] == 3" ? "THREE CARD" : "TWO PAIR");
}
else if (a.length == 4) {
writeln("ONE PAIR");
}
else {
writeln("NO HAND");
}
}
void scan(T...)(ref T args) {
import std.stdio : readln;
import std.array : split;
import std.conv : to;
import std.range.primitives;
string[] line = readln.split;
foreach (ref arg; args) {
arg = line.front.to!(typeof(arg));
line.popFront();
}
assert(line.empty);
}
void fillAll(R, T)(ref R arr, T value) {
static if (is(typeof(arr[] = value))) {
arr[] = value;
}
else {
foreach (ref e; arr) {
fillAll(e, value);
}
}
}