結果
| 問題 |
No.227 簡単ポーカー
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-05-02 03:56:49 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 522 bytes |
| コンパイル時間 | 590 ms |
| コンパイル使用メモリ | 69,368 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-14 04:34:13 |
| 合計ジャッジ時間 | 1,201 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
ソースコード
#include <iostream>
#include <map>
using namespace std;
int main(int argc, const char* argv[])
{
int A[5];
for (auto&& a : A) cin >> a;
map<int, int> m;
for (auto&& a : A) m[a]++;
string ret = "NO HAND";
map<int, int> cnts;
for (auto&& v : m) cnts[v.second]++;
if (cnts[3] == 1 && cnts[1] == 2) ret = "THREE CARD";
if (cnts[2] == 2 && cnts[1] == 1) ret = "TWO PAIR";
if (cnts[2] == 1 && cnts[1] == 3) ret = "ONE PAIR";
if (cnts[3] == 1 && cnts[2] == 1) ret = "FULL HOUSE";
cout << ret << endl;
return 0;
}